Skip to content

Commit

Permalink
Merge pull request #263 from chain4travel/header-address
Browse files Browse the repository at this point in the history
Fix Address Display Bug When Switching to Imported Key
  • Loading branch information
Ysrbolles authored Oct 22, 2024
2 parents 346cd83 + e2ff931 commit 557e5e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/redux/slices/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ const appConfigSlice = createSlice({
state.walletStore = payload
},
updatePchainAddress(state, { payload }) {
state.pChainAddress = payload.address[0]
const Address = store.getters.addresses[0].replace('X-', 'P-')
const activeAddress = payload.address.find((adr: string) => adr === Address) || null

state.pChainAddress = activeAddress
state.walletName =
payload.walletName !== 'Singleton Wallet' ? payload.walletName : payload.address[0]
payload.walletName !== 'Singleton Wallet' ? payload.walletName : activeAddress
},

updateAccount(state, { payload }) {
state.account = payload
},
Expand Down

0 comments on commit 557e5e7

Please sign in to comment.