Browse Source

Clean up unused functions on events page

master
buttercat1791 7 months ago
parent
commit
82f0d46abd
  1. 44
      src/routes/events/+page.svelte

44
src/routes/events/+page.svelte

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
import EventInput from "$lib/components/EventInput.svelte";
import CopyToClipboard from "$lib/components/util/CopyToClipboard.svelte";
import { neventEncode, naddrEncode } from "$lib/utils";
import { activeInboxRelays, activeOutboxRelays, getNdkContext } from "$lib/ndk";
import { activeInboxRelays, getNdkContext } from "$lib/ndk";
import { getEventType } from "$lib/utils/mime";
import ViewPublicationLink from "$lib/components/util/ViewPublicationLink.svelte";
import { checkCommunity } from "$lib/utils/search_utility";
@ -49,13 +49,6 @@ @@ -49,13 +49,6 @@
// Get NDK context during component initialization
const ndk = getNdkContext();
// Debug: Check if user is logged in
$effect(() => {
console.log("[Events Page] User state:", user);
console.log("[Events Page] User signed in:", user?.signedIn);
console.log("[Events Page] User pubkey:", user?.pubkey);
});
function handleEventFound(newEvent: NDKEvent) {
event = newEvent;
showSidePanel = true;
@ -321,18 +314,6 @@ @@ -321,18 +314,6 @@
goto("/events", { replaceState: true });
}
function handleClearCache() {
clearAllCaches();
// Force a page refresh to ensure all caches are cleared
window.location.reload();
}
function handleClearProfileCache() {
clearProfileCaches();
// Force a page refresh to ensure profile caches are cleared
window.location.reload();
}
function closeSidePanel() {
showSidePanel = false;
event = null;
@ -384,18 +365,7 @@ @@ -384,18 +365,7 @@
}
// AI-NOTE: 2025-01-24 - Function to parse profile content from kind 0 events
function parseProfileContent(event: NDKEvent): {
name?: string;
display_name?: string;
about?: string;
picture?: string;
banner?: string;
website?: string;
lud16?: string;
nip05?: string;
isInUserLists?: boolean;
listKinds?: number[];
} | null {
function parseProfileContent(event: NDKEvent): UserProfile | null {
if (event.kind !== 0 || !event.content) {
return null;
}
@ -446,16 +416,6 @@ @@ -446,16 +416,6 @@
return addr.slice(0, head) + "…" + addr.slice(-tail);
}
function formatEventDate(event: NDKEvent): string {
if (event.created_at) {
return new Date(event.created_at * 1000).toLocaleDateString();
}
if ((event as any).timestamp) {
return new Date((event as any).timestamp * 1000).toLocaleDateString();
}
return "Unknown date";
}
function onLoadingChange(val: boolean) {
loading = val;
searchInProgress =

Loading…
Cancel
Save