Skip to content

Commit

Permalink
fix: metamask migration dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tomicvladan committed Dec 13, 2023
1 parent 266c086 commit b736655
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const MetamaskMigrationDialog = ({
if (clickOutside) {
return;
}
setMetamaskMigrationNotification('closed');
setMetamaskMigrationNotification(
step === Step.COMPLETE ? 'completed' : 'closed'
);
onClose();
};

Expand Down
21 changes: 13 additions & 8 deletions src/context/FdpStorageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
};
Expand Down
8 changes: 3 additions & 5 deletions src/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,9 @@
scrollbar-width: none; /* Firefox */
}

.light {
.blurred-text {
color: transparent;
text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.blurred-text {
color: transparent;
text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.dark {
Expand Down

0 comments on commit b736655

Please sign in to comment.