Fix wallet logs not updated after server delete
This commit is contained in:
parent
9509833b88
commit
d60e26bfdf
|
@ -175,11 +175,15 @@ function useServerConfig (wallet) {
|
||||||
}, [client, walletId])
|
}, [client, walletId])
|
||||||
|
|
||||||
const clearConfig = useCallback(async () => {
|
const clearConfig = useCallback(async () => {
|
||||||
await client.mutate({
|
try {
|
||||||
mutation: REMOVE_WALLET,
|
await client.mutate({
|
||||||
variables: { id: walletId }
|
mutation: REMOVE_WALLET,
|
||||||
})
|
variables: { id: walletId }
|
||||||
refetchConfig()
|
})
|
||||||
|
} finally {
|
||||||
|
client.refetchQueries({ include: ['WalletLogs'] })
|
||||||
|
refetchConfig()
|
||||||
|
}
|
||||||
}, [client, walletId])
|
}, [client, walletId])
|
||||||
|
|
||||||
return [config, saveConfig, clearConfig]
|
return [config, saveConfig, clearConfig]
|
||||||
|
|
Loading…
Reference in New Issue