force refresh client wallets when device sync is enabled
This commit is contained in:
parent
00c047f09b
commit
fdc3df9c15
|
@ -10,9 +10,11 @@ import CancelButton from './cancel-button'
|
|||
import * as yup from 'yup'
|
||||
import { deviceSyncSchema } from '@/lib/validate'
|
||||
import RefreshIcon from '@/svgs/refresh-line.svg'
|
||||
import { useApolloClient } from '@apollo/client'
|
||||
|
||||
export default function DeviceSync () {
|
||||
const { me } = useMe()
|
||||
const apollo = useApolloClient()
|
||||
const [value, setVaultKey, clearVault, disconnectVault] = useVaultConfigurator()
|
||||
const showModal = useShowModal()
|
||||
|
||||
|
@ -105,6 +107,9 @@ export default function DeviceSync () {
|
|||
try {
|
||||
await setVaultKey(values.passphrase)
|
||||
await migrate()
|
||||
apollo.cache.evict({ fieldName: 'BestWallets' })
|
||||
apollo.cache.gc()
|
||||
await apollo.refetchQueries({ include: ['BestWallets'] })
|
||||
} catch (e) {
|
||||
formik?.setErrors({ passphrase: e.message })
|
||||
throw e
|
||||
|
|
|
@ -209,7 +209,7 @@ export const BEST_WALLETS = gql`
|
|||
}
|
||||
`
|
||||
export const BEST_SEND_WALLETS = gql`
|
||||
query BestWallets {
|
||||
query BestSendWallets {
|
||||
wallets (includeSenders: true, includeReceivers: false, onlyEnabled: true, prioritySort: "asc") {
|
||||
id
|
||||
priority
|
||||
|
|
Loading…
Reference in New Issue