File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
packages/secure-background/src/store Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 11import type {
2- Blockchain , BlockchainKeyringJson ,
2+ Blockchain ,
3+ BlockchainKeyringJson ,
34 DeprecatedWalletDataDoNotUse ,
4- Preferences } from "@coral-xyz/common" ;
5+ Preferences ,
6+ } from "@coral-xyz/common" ;
57
68import type { SecretPayload } from "./keyring/crypto" ;
79import { 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 }
You can’t perform that action at this time.
0 commit comments