Skip to content

Commit 328e20b

Browse files
committed
fix issue where secrets would not get auto-decrypted properly
1 parent 7b0bae3 commit 328e20b

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

src/popup.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { Notification } from "./store/Notification";
1818
import { Qr } from "./store/Qr";
1919
import { Advisor } from "./store/Advisor";
2020
import { Dropbox, Drive, OneDrive } from "./models/backup";
21-
import { EntryStorage } from "./models/storage";
2221

2322
async function init() {
2423
// Add globals
@@ -62,27 +61,12 @@ async function init() {
6261

6362
// Prompt for password if needed
6463
if (instance.$store.state.accounts.shouldShowPassphrase) {
65-
instance.$store.commit("style/showInfo", true);
6664
// If we have cached password, use that
6765
if (instance.$store.state.accounts.encryption.getEncryptionStatus()) {
6866
instance.$store.commit("currentView/changeView", "LoadingPage");
69-
for (const entry of instance.$store.state.accounts.entries) {
70-
await entry.applyEncryption(instance.$store.state.accounts.encryption);
71-
}
72-
instance.$store.commit(
73-
"accounts/updateExport",
74-
await EntryStorage.getExport(instance.$store.state.accounts.entries)
75-
);
76-
instance.$store.commit(
77-
"accounts/updateEncExport",
78-
await EntryStorage.getExport(
79-
instance.$store.state.accounts.entries,
80-
true
81-
)
82-
);
83-
instance.$store.commit("accounts/updateCodes");
84-
instance.$store.commit("style/hideInfo", true);
67+
await instance.$store.dispatch("accounts/updateEntries");
8568
} else {
69+
instance.$store.commit("style/showInfo", true);
8670
instance.$store.commit("currentView/changeView", "EnterPasswordPage");
8771
}
8872
}

src/store/Accounts.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export class Accounts implements Module {
88
async getModule() {
99
const cachedPassphrase = await this.getCachedPassphrase();
1010
const encryption: Encryption = new Encryption(cachedPassphrase);
11-
const shouldShowPassphrase = cachedPassphrase
12-
? false
13-
: await EntryStorage.hasEncryptionKey();
11+
const shouldShowPassphrase = await EntryStorage.hasEncryptionKey();
1412
const entries = shouldShowPassphrase ? [] : await this.getEntries();
1513

1614
return {

0 commit comments

Comments
 (0)