Skip to content

Commit 92ef546

Browse files
authored
fix onboarding issue (#4259)
1 parent 5de03ce commit 92ef546

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/secure-background/src/store/SecureStore.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type {
2-
Blockchain, BlockchainKeyringJson,
2+
Blockchain,
3+
BlockchainKeyringJson,
34
DeprecatedWalletDataDoNotUse,
4-
Preferences } from "@coral-xyz/common";
5+
Preferences,
6+
} from "@coral-xyz/common";
57

68
import type { SecretPayload } from "./keyring/crypto";
79
import { decrypt, encrypt } from "./keyring/crypto";
@@ -98,10 +100,7 @@ export class SecureStore {
98100
}
99101

100102
async setIsCold(publicKey: string, isCold?: boolean) {
101-
let keynames = await this.db.get(KEY_IS_COLD_STORE);
102-
if (!keynames) {
103-
keynames = {};
104-
}
103+
const keynames = (await this.db.get(KEY_IS_COLD_STORE)) || {};
105104
keynames[publicKey] = isCold;
106105
await this.db.set(KEY_IS_COLD_STORE, keynames);
107106
}
@@ -113,7 +112,7 @@ export class SecureStore {
113112
}
114113

115114
async setKeyname(publicKey: string, name: string, blockchain: Blockchain) {
116-
let keynames = await this.db.get(KEY_KEYNAME_STORE);
115+
const keynames = (await this.db.get(KEY_KEYNAME_STORE)) || {};
117116
if (!keynames[blockchain]) {
118117
keynames[blockchain] = {};
119118
}

0 commit comments

Comments
 (0)