Add 'nostr' prefix to author queryKey

This commit is contained in:
Alex Gleason committed 2026-02-21 13:53:09 -06:00
1 parent 8a69f988ce
commit 12dcbfdb33
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -108,7 +108,7 @@ export const EditProfileForm: React.FC = () => {
// Invalidate queries to refresh the data
queryClient.invalidateQueries({ queryKey: ['logins'] });
queryClient.invalidateQueries({ queryKey: ['author', user.pubkey] });
queryClient.invalidateQueries({ queryKey: ['nostr', 'author', user.pubkey] });
toast({
title: 'Success',
+1 -1
View File
@@ -6,7 +6,7 @@ export function useAuthor(pubkey: string | undefined) {
const { nostr } = useNostr();
return useQuery<{ event?: NostrEvent; metadata?: NostrMetadata }>({
queryKey: ['author', pubkey ?? ''],
queryKey: ['nostr', 'author', pubkey ?? ''],
queryFn: async ({ signal }) => {
if (!pubkey) {
return {};
+3 -3
View File
@@ -41,7 +41,7 @@ export function useZaps(
}, []);
const { data: zapEvents, ...query } = useQuery<NostrEvent[], Error>({
queryKey: ['zaps', actualTarget?.id],
queryKey: ['nostr', 'zaps', actualTarget?.id],
staleTime: 30000, // 30 seconds
refetchInterval: (query) => {
// Only refetch if the query is currently being observed (component is mounted)
@@ -246,7 +246,7 @@ export function useZaps(
});
// Invalidate zap queries to refresh counts
queryClient.invalidateQueries({ queryKey: ['zaps'] });
queryClient.invalidateQueries({ queryKey: ['nostr', 'zaps'] });
// Close dialog last to ensure clean state
onZapSuccess?.();
@@ -290,7 +290,7 @@ export function useZaps(
});
// Invalidate zap queries to refresh counts
queryClient.invalidateQueries({ queryKey: ['zaps'] });
queryClient.invalidateQueries({ queryKey: ['nostr', 'zaps'] });
// Close dialog last to ensure clean state
onZapSuccess?.();