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