avoid uncaught error during login due to getEncryptionKey (#1468)

This commit is contained in:
Abhinav Kumar 2023-11-28 16:17:14 +05:30 committed by GitHub
commit b240f8c10d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -132,7 +132,11 @@ export default function LandingPage() {
const user = getData(LS_KEYS.USER);
let key = getKey(SESSION_KEYS.ENCRYPTION_KEY);
if (!key && isElectron()) {
key = await ElectronAPIs.getEncryptionKey();
try {
key = await ElectronAPIs.getEncryptionKey();
} catch (e) {
logError(e, 'getEncryptionKey failed');
}
if (key) {
await saveKeyInSessionStore(
SESSION_KEYS.ENCRYPTION_KEY,

View file

@ -73,7 +73,11 @@ export default function Credentials({
setUser(user);
let key = getKey(SESSION_KEYS.ENCRYPTION_KEY);
if (!key && isElectron()) {
key = await ElectronAPIs.getEncryptionKey();
try {
key = await ElectronAPIs.getEncryptionKey();
} catch (e) {
logError(e, 'getEncryptionKey failed');
}
if (key) {
await saveKeyInSessionStore(
SESSION_KEYS.ENCRYPTION_KEY,