mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-03 08:07:21 +00:00
Add 'nostr' prefix to author queryKey
This commit is contained in:
3 files changed
+5
-5
No files matched your search
@@ -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',
|
||||
|
||||
@@ -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 {};
|
||||
|
||||
@@ -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?.();
|
||||
|
||||
Reference in new issue
Block a user