only use sessionStorage when needed (#179)

This commit is contained in:
gotjoshua 2021-04-12 14:18:10 +01:00 committed by GitHub
parent fff264a7ea
commit 570cfcec6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -50,9 +50,9 @@ let unlockedMnemonicAndSeed = (async () => {
localStorage.removeItem('unlockedExpiration');
}
const stored = JSON.parse(
(await getExtensionUnlockedMnemonic()) ||
sessionStorage.getItem('unlocked') ||
localStorage.getItem('unlocked') ||
(await getExtensionUnlockedMnemonic()) ||
'null',
);
if (stored === null) {
@ -176,8 +176,9 @@ export async function loadMnemonicAndSeed(password, stayLoggedIn) {
method: 'set',
data: decodedPlaintext,
});
} else {
sessionStorage.setItem('unlocked', decodedPlaintext);
}
sessionStorage.setItem('unlocked', decodedPlaintext);
}
const importsEncryptionKey = deriveImportsEncryptionKey(seed);
setUnlockedMnemonicAndSeed(