diff --git a/packages/background/src/backend/core.ts b/packages/background/src/backend/core.ts index 8bc6a149a..0efabd5ce 100644 --- a/packages/background/src/backend/core.ts +++ b/packages/background/src/backend/core.ts @@ -88,8 +88,8 @@ import type { EthereumConnectionBackend } from "./ethereum-connection"; import { KeyringStore } from "./keyring"; import type { SolanaConnectionBackend } from "./solana-connection"; import type { Nav, User } from "./store"; +import { getNav , getWalletDataForUser, setUser, setWalletDataForUser } from "./store"; import * as store from "./store"; -import { getWalletDataForUser, setUser, setWalletDataForUser } from "./store"; const { base58: bs58 } = ethers.utils; @@ -636,6 +636,21 @@ export class Backend { const xnftPreferences = await this.getXnftPreferences(); const blockchainKeyrings = await this.blockchainKeyringsRead(); + // Reset the navigation to the default everytime we switch users + // but keep the active tab. + const { activeTab } = (await store.getNav())!; + await store.setNav({ + ...defaultNav, + activeTab, + }); + const url = defaultNav.data[activeTab].urls[0]; + this.events.emit(BACKEND_EVENT, { + name: NOTIFICATION_NAVIGATION_URL_DID_CHANGE, + data: { + url, + }, + }); + // Push it. this.events.emit(BACKEND_EVENT, { name: NOTIFICATION_KEYRING_STORE_ACTIVE_USER_UPDATED,