diff --git a/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx b/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx index 444301d1..5baf0125 100644 --- a/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx +++ b/src/components/Dialogs/MetamaskMigrationDialog/MetamaskCreateAccount.tsx @@ -97,7 +97,7 @@ export default function MetamaskCreateAccount({ await fdpClientRef.current.account.register(request); setWallet(fdpClientRef.current.account.wallet); - setFdpStorageType('native'); + setFdpStorageType('native', undefined, false); setIsLoggedIn(true); setLoginType('username'); setUser(username); diff --git a/src/components/Dialogs/MetamaskMigrationDialog/MetamaskMigrationDialog.tsx b/src/components/Dialogs/MetamaskMigrationDialog/MetamaskMigrationDialog.tsx index 997c187d..b0791063 100644 --- a/src/components/Dialogs/MetamaskMigrationDialog/MetamaskMigrationDialog.tsx +++ b/src/components/Dialogs/MetamaskMigrationDialog/MetamaskMigrationDialog.tsx @@ -55,7 +55,9 @@ const MetamaskMigrationDialog = ({ if (clickOutside) { return; } - setMetamaskMigrationNotification('closed'); + setMetamaskMigrationNotification( + step === Step.COMPLETE ? 'completed' : 'closed' + ); onClose(); }; diff --git a/src/context/FdpStorageContext.tsx b/src/context/FdpStorageContext.tsx index 59d8ab16..db12b716 100644 --- a/src/context/FdpStorageContext.tsx +++ b/src/context/FdpStorageContext.tsx @@ -70,7 +70,8 @@ interface FdpStorageContext { setWallet: (wallet: Wallet) => void; setFdpStorageType: ( type: FDP_STORAGE_TYPE, - config?: FdpContracts.EnsEnvironment + config?: FdpContracts.EnsEnvironment, + create?: boolean ) => void; setFdpStorageConfig: (config: FdpContracts.EnsEnvironment) => void; setUsername: (username: string) => void; @@ -153,15 +154,19 @@ function FdpStorageProvider(props: FdpStorageContextProps) { */ const setFdpStorageType = ( type: FDP_STORAGE_TYPE, - config?: FdpContracts.EnsEnvironment + config?: FdpContracts.EnsEnvironment, + create = true ) => { - if (type === 'native') { - fdpClientRef.current = createFdpStorage(config); - } else if (type === 'blossom') { - fdpClientRef.current = blossom.fdpStorage; - } else { - throw new Error('Unknown FDP storage type'); + if (create) { + if (type === 'native') { + fdpClientRef.current = createFdpStorage(config); + } else if (type === 'blossom') { + fdpClientRef.current = blossom.fdpStorage; + } else { + throw new Error('Unknown FDP storage type'); + } } + setIsLoggedIn(false); setStorageType(type); };