diff --git a/components/device-sync.js b/components/device-sync.js index 73818aff..67273d3c 100644 --- a/components/device-sync.js +++ b/components/device-sync.js @@ -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 diff --git a/fragments/wallet.js b/fragments/wallet.js index af8ba5a1..b5a0e820 100644 --- a/fragments/wallet.js +++ b/fragments/wallet.js @@ -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