Fix the whole UI blowing up when changing relays

This commit is contained in:
Alex Gleason committed 2025-10-16 18:41:18 -05:00
1 parent d2a668e3ee
commit 9f32bb135b
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ const NostrProvider: React.FC<NostrProviderProps> = (props) => {
// Update refs when config changes // Update refs when config changes
useEffect(() => { useEffect(() => {
relayUrl.current = config.relayUrl; relayUrl.current = config.relayUrl;
queryClient.resetQueries(); queryClient.invalidateQueries({ queryKey: ['nostr'] });
}, [config.relayUrl, queryClient]); }, [config.relayUrl, queryClient]);
// Initialize NPool only once // Initialize NPool only once
+1 -1
View File
@@ -39,7 +39,7 @@ export function useAppSubmissions() {
const { nostr } = useNostr(); const { nostr } = useNostr();
return useQuery({ return useQuery({
queryKey: ['app-submissions'], queryKey: ['nostr', 'app-submissions'],
queryFn: async (): Promise<AppSubmission[]> => { queryFn: async (): Promise<AppSubmission[]> => {
// Get Soapbox team follow pack for auto-approval // Get Soapbox team follow pack for auto-approval
const teamPubkeys = new Set<string>(); const teamPubkeys = new Set<string>();
+1 -1
View File
@@ -6,7 +6,7 @@ export function useComments(root: NostrEvent | URL, limit?: number) {
const { nostr } = useNostr(); const { nostr } = useNostr();
return useQuery({ return useQuery({
queryKey: ['comments', root instanceof URL ? root.toString() : root.id, limit], queryKey: ['nostr', 'comments', root instanceof URL ? root.toString() : root.id, limit],
queryFn: async (c) => { queryFn: async (c) => {
const filter: NostrFilter = { kinds: [1111] }; const filter: NostrFilter = { kinds: [1111] };
+1 -1
View File
@@ -15,7 +15,7 @@ export function useLoggedInAccounts() {
const { logins, setLogin, removeLogin } = useNostrLogin(); const { logins, setLogin, removeLogin } = useNostrLogin();
const { data: authors = [], isLoading } = useQuery({ const { data: authors = [], isLoading } = useQuery({
queryKey: ['logins', logins.map((l) => l.id).join(';')], queryKey: ['nostr', 'logins', logins.map((l) => l.id).join(';')],
queryFn: async ({ signal }) => { queryFn: async ({ signal }) => {
const events = await nostr.query( const events = await nostr.query(
[{ kinds: [0], authors: logins.map((l) => l.pubkey) }], [{ kinds: [0], authors: logins.map((l) => l.pubkey) }],