diff --git a/PKGBUILD b/PKGBUILD index ec83c41..8f0a69a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: hoornet pkgname=wrystr -pkgver=0.8.0 +pkgver=0.8.1 pkgrel=1 pkgdesc="Cross-platform Nostr desktop client with Lightning integration" arch=('x86_64') diff --git a/package.json b/package.json index 96dd106..e3ce928 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wrystr", "private": true, - "version": "0.8.0", + "version": "0.8.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 7ce056f..117860a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wrystr" -version = "0.8.0" +version = "0.8.1" description = "Cross-platform Nostr desktop client with Lightning integration" authors = ["hoornet"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2255c36..76b5daa 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Wrystr", - "version": "0.8.0", + "version": "0.8.1", "identifier": "com.hoornet.wrystr", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/components/profile/ProfileView.tsx b/src/components/profile/ProfileView.tsx index 81ca346..aefdf78 100644 --- a/src/components/profile/ProfileView.tsx +++ b/src/components/profile/ProfileView.tsx @@ -352,14 +352,14 @@ export function ProfileView() {
{/* Banner */} {profile?.banner ? ( -
+
{!bannerLoaded && (
)} setBannerLightbox(true)} onLoad={() => setBannerLoaded(true)} onError={(e) => { (e.target as HTMLImageElement).style.display = "none"; }} diff --git a/src/lib/nostr/client.ts b/src/lib/nostr/client.ts index cfc168c..8e1ad09 100644 --- a/src/lib/nostr/client.ts +++ b/src/lib/nostr/client.ts @@ -950,14 +950,22 @@ export async function advancedSearch(parsed: ParsedSearch, limit = 50): Promise< const opts = { cacheUsage: NDKSubscriptionCacheUsage.ONLY_RELAY }; + // Wrap fetchEvents with a timeout — NDK can hang forever if no relay supports the filter + const fetchWithTimeout = (filter: NDKFilter & { search?: string }, timeoutMs = 8000): Promise> => { + return Promise.race([ + instance.fetchEvents(filter, opts), + new Promise>((resolve) => setTimeout(() => resolve(new Set()), timeoutMs)), + ]); + }; + const noteFilter = noteKinds.length > 0 ? buildFilter(noteKinds) : null; const articleFilter = articleKinds.length > 0 ? buildFilter(articleKinds) : null; const shouldSearchUsers = (!hasKindFilter || parsed.kinds.includes(0)) && hasSearch && !hasHashtags; const [noteEvents, articleEvents, userEvents] = await Promise.all([ - noteFilter ? instance.fetchEvents(noteFilter, opts) : Promise.resolve(new Set()), - articleFilter ? instance.fetchEvents(articleFilter, opts) : Promise.resolve(new Set()), - shouldSearchUsers ? instance.fetchEvents({ kinds: [NDKKind.Metadata], search: searchText, limit: 20 } as NDKFilter & { search: string }, opts) : Promise.resolve(new Set()), + noteFilter ? fetchWithTimeout(noteFilter) : Promise.resolve(new Set()), + articleFilter ? fetchWithTimeout(articleFilter) : Promise.resolve(new Set()), + shouldSearchUsers ? fetchWithTimeout({ kinds: [NDKKind.Metadata], search: searchText, limit: 20 } as NDKFilter & { search: string }) : Promise.resolve(new Set()), ]); let notes = Array.from(noteEvents);