frontend client for gemstone. decentralised workplace app
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: use query key from hook instead

serenity 02039883 15d47c4a

+6 -2
+3 -1
src/components/Settings/RegisterLatticeModalContent.tsx
··· 7 7 useOAuthSessionGuaranteed, 8 8 } from "@/providers/OAuthProvider"; 9 9 import { useCurrentPalette } from "@/providers/ThemeProvider"; 10 + import { useLatticesQuery } from "@/queries/hooks/useLatticesQuery"; 10 11 import { useMutation, useQueryClient } from "@tanstack/react-query"; 11 12 import type { Dispatch, SetStateAction } from "react"; 12 13 import { useState } from "react"; ··· 26 27 const agent = useOAuthAgentGuaranteed(); 27 28 const session = useOAuthSessionGuaranteed(); 28 29 const queryClient = useQueryClient(); 30 + const { queryKey: latticesQueryKey } = useLatticesQuery(session); 29 31 const { mutate: newLatticeMutation, isPending: mutationPending } = 30 32 useMutation({ 31 33 mutationFn: async () => { ··· 46 48 }, 47 49 onSuccess: async () => { 48 50 await queryClient.invalidateQueries({ 49 - queryKey: ["lattice", session.did], 51 + queryKey: latticesQueryKey, 50 52 }); 51 53 setShowRegisterModal(false); 52 54 },
+3 -1
src/components/Settings/RegisterShardModalContent.tsx
··· 7 7 useOAuthSessionGuaranteed, 8 8 } from "@/providers/OAuthProvider"; 9 9 import { useCurrentPalette } from "@/providers/ThemeProvider"; 10 + import { useShardsQuery } from "@/queries/hooks/useShardsQuery"; 10 11 import { useMutation, useQueryClient } from "@tanstack/react-query"; 11 12 import type { Dispatch, SetStateAction } from "react"; 12 13 import { useState } from "react"; ··· 26 27 const agent = useOAuthAgentGuaranteed(); 27 28 const session = useOAuthSessionGuaranteed(); 28 29 const queryClient = useQueryClient(); 30 + const { queryKey: shardsQueryKey } = useShardsQuery(session) 29 31 const { mutate: newShardMutation, isPending: mutationPending } = 30 32 useMutation({ 31 33 mutationFn: async () => { ··· 46 48 }, 47 49 onSuccess: async () => { 48 50 await queryClient.invalidateQueries({ 49 - queryKey: ["shard", session.did], 51 + queryKey: shardsQueryKey, 50 52 }); 51 53 setShowRegisterModal(false); 52 54 },