Fix wallet logs not updated after server delete

This commit is contained in:
ekzyis 2024-07-04 21:24:34 +02:00
parent 9509833b88
commit d60e26bfdf
1 changed files with 9 additions and 5 deletions

View File

@ -175,11 +175,15 @@ function useServerConfig (wallet) {
}, [client, walletId])
const clearConfig = useCallback(async () => {
await client.mutate({
mutation: REMOVE_WALLET,
variables: { id: walletId }
})
refetchConfig()
try {
await client.mutate({
mutation: REMOVE_WALLET,
variables: { id: walletId }
})
} finally {
client.refetchQueries({ include: ['WalletLogs'] })
refetchConfig()
}
}, [client, walletId])
return [config, saveConfig, clearConfig]