Skip to content

Commit

Permalink
πŸ› fix: session dev mode init (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
rustin01 authored Sep 10, 2024
1 parent 73be97d commit 7bdae39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/wallet/src/stores/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class HibitIdSession {
public chainInfo: ChainInfo
public config: SessionConfig = {
lastChainId: '',
devMode: false
devMode: HIBIT_ENV === HibitEnv.PROD ? false : true,
}

private _mnemonic: GetMnemonicResult | null = null
Expand All @@ -45,9 +45,9 @@ export class HibitIdSession {
const configString = localStorage.getItem(SESSION_CONFIG_KEY)
if (configString) {
const config = JSON.parse(configString) as SessionConfig
this.config = config
const chainId = ChainId.fromString(config.lastChainId)
const chainInfo = getChainByChainId(chainId, config.devMode)
this.config = { ...this.config, ...config }
const chainId = ChainId.fromString(this.config.lastChainId)
const chainInfo = getChainByChainId(chainId, this.config.devMode)
if (chainInfo) {
initialChainInfo = chainInfo
}
Expand Down

0 comments on commit 7bdae39

Please sign in to comment.