mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +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
|
// Invalidate queries to refresh the data
|
||||||
queryClient.invalidateQueries({ queryKey: ['logins'] });
|
queryClient.invalidateQueries({ queryKey: ['logins'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['author', user.pubkey] });
|
queryClient.invalidateQueries({ queryKey: ['nostr', 'author', user.pubkey] });
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: 'Success',
|
title: 'Success',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export function useAuthor(pubkey: string | undefined) {
|
|||||||
const { nostr } = useNostr();
|
const { nostr } = useNostr();
|
||||||
|
|
||||||
return useQuery<{ event?: NostrEvent; metadata?: NostrMetadata }>({
|
return useQuery<{ event?: NostrEvent; metadata?: NostrMetadata }>({
|
||||||
queryKey: ['author', pubkey ?? ''],
|
queryKey: ['nostr', 'author', pubkey ?? ''],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
if (!pubkey) {
|
if (!pubkey) {
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function useZaps(
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const { data: zapEvents, ...query } = useQuery<NostrEvent[], Error>({
|
const { data: zapEvents, ...query } = useQuery<NostrEvent[], Error>({
|
||||||
queryKey: ['zaps', actualTarget?.id],
|
queryKey: ['nostr', 'zaps', actualTarget?.id],
|
||||||
staleTime: 30000, // 30 seconds
|
staleTime: 30000, // 30 seconds
|
||||||
refetchInterval: (query) => {
|
refetchInterval: (query) => {
|
||||||
// Only refetch if the query is currently being observed (component is mounted)
|
// 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
|
// Invalidate zap queries to refresh counts
|
||||||
queryClient.invalidateQueries({ queryKey: ['zaps'] });
|
queryClient.invalidateQueries({ queryKey: ['nostr', 'zaps'] });
|
||||||
|
|
||||||
// Close dialog last to ensure clean state
|
// Close dialog last to ensure clean state
|
||||||
onZapSuccess?.();
|
onZapSuccess?.();
|
||||||
@@ -290,7 +290,7 @@ export function useZaps(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Invalidate zap queries to refresh counts
|
// Invalidate zap queries to refresh counts
|
||||||
queryClient.invalidateQueries({ queryKey: ['zaps'] });
|
queryClient.invalidateQueries({ queryKey: ['nostr', 'zaps'] });
|
||||||
|
|
||||||
// Close dialog last to ensure clean state
|
// Close dialog last to ensure clean state
|
||||||
onZapSuccess?.();
|
onZapSuccess?.();
|
||||||
|
|||||||
Reference in new issue
Block a user