Fix wallet logs refetch

onError does not exist on client.mutate
This commit is contained in:
ekzyis 2024-07-03 04:45:28 +02:00
parent 4bf9954c4e
commit 5b561e22a9
1 changed files with 15 additions and 16 deletions

View File

@ -150,23 +150,22 @@ function useServerConfig (wallet) {
priority,
...config
}) => {
return await client.mutate({
mutation: wallet.server.mutation,
refetchQueries: ['WalletLogs'],
onError: (err) => {
client.refetchQueries({ include: ['WalletLogs'] })
throw err
},
variables: {
id: walletId,
...config,
settings: {
autoWithdrawThreshold: Number(autoWithdrawThreshold),
autoWithdrawMaxFeePercent: Number(autoWithdrawMaxFeePercent),
priority: !!priority
try {
return await client.mutate({
mutation: wallet.server.mutation,
variables: {
id: walletId,
...config,
settings: {
autoWithdrawThreshold: Number(autoWithdrawThreshold),
autoWithdrawMaxFeePercent: Number(autoWithdrawMaxFeePercent),
priority: !!priority
}
}
}
})
})
} finally {
client.refetchQueries({ include: ['WalletLogs'] })
}
}, [client, walletId])
const clearConfig = useCallback(async () => {