Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong identity providers #429

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/browser-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Recovery can now be aborted when an identity has not yet been found.

### Fixed

- An issue where, in some cases, the wrong list of identity providers was used when recovering from the wallet settings menu.

## 1.3.2

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@concordium/browser-wallet",
"private": true,
"version": "1.3.2",
"version": "1.4.0",
orhoj marked this conversation as resolved.
Show resolved Hide resolved
"description": "Browser extension wallet for the Concordium blockchain",
"author": "Concordium Software",
"license": "Apache-2.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/browser-wallet/src/popup/store/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { storedAllowlist, storedCredentials } from '@shared/storage/access';
import { GRPCTIMEOUT, mainnet } from '@shared/constants/networkConfiguration';
import { atomWithChromeStorage } from './utils';
import { selectedAccountAtom } from './account';
import { selectedIdentityIndexAtom } from './identity';
import { identityProvidersAtom, selectedIdentityIndexAtom } from './identity';

export const encryptedSeedPhraseAtom = atomWithChromeStorage<EncryptedData | undefined>(
ChromeStorageKey.SeedPhrase,
Expand All @@ -37,8 +37,12 @@ export const networkConfigurationAtom = atom<NetworkConfiguration, NetworkConfig
const selectedAccount = credentials?.length ? credentials[0]?.address : undefined;
const accountPromise = set(selectedAccountAtom, selectedAccount);

// As identity providers are different per network, we must also reset the list of cached
// identity providers when the network configuration is changed.
const identityProviderPromise = set(identityProvidersAtom, []);

// Wait for all the derived state of a network change to be done before broadcasting
await Promise.all([networkPromise, identityPromise, accountPromise]);
await Promise.all([networkPromise, identityPromise, accountPromise, identityProviderPromise]);

const allowlist = await storedAllowlist.get();
popupMessageHandler.broadcast(EventType.ChainChanged, networkConfiguration.genesisHash, {
Expand Down
Loading