diff --git a/src/components/BookmarkList.tsx b/src/components/BookmarkList.tsx index 2f0a8a28..5cb96434 100644 --- a/src/components/BookmarkList.tsx +++ b/src/components/BookmarkList.tsx @@ -111,16 +111,18 @@ export const BookmarkList: React.FC = ({ isMobile={isMobile} /> - {loading ? ( -
- -
- ) : allIndividualBookmarks.length === 0 ? ( -
-

No bookmarks found.

-

Add bookmarks using your nostr client to see them here.

-

If you aren't on nostr yet, start here: nstart.me

-
+ {allIndividualBookmarks.length === 0 ? ( + loading ? ( +
+ +
+ ) : ( +
+

No bookmarks found.

+

Add bookmarks using your nostr client to see them here.

+

If you aren't on nostr yet, start here: nstart.me

+
+ ) ) : (
diff --git a/src/hooks/useBookmarksData.ts b/src/hooks/useBookmarksData.ts index e9c519f8..adec2fae 100644 --- a/src/hooks/useBookmarksData.ts +++ b/src/hooks/useBookmarksData.ts @@ -44,10 +44,14 @@ export const useBookmarksData = ({ const handleFetchBookmarks = useCallback(async () => { if (!relayPool || !activeAccount) return + // don't clear existing bookmarks: we keep UI stable and show spinner unobtrusively setBookmarksLoading(true) try { const fullAccount = accountManager.getActive() - await fetchBookmarks(relayPool, fullAccount || activeAccount, setBookmarks, settings) + // merge-friendly: updater form that preserves visible list until replacement + await fetchBookmarks(relayPool, fullAccount || activeAccount, (next) => { + setBookmarks(() => next) + }, settings) } finally { setBookmarksLoading(false) }