Skip to content

Commit

Permalink
Merge branch 'develop' into Ahmed/format-nums
Browse files Browse the repository at this point in the history
  • Loading branch information
vsubhuman authored Jun 16, 2023
2 parents a08ec7f + 145e2da commit be6bb81
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default class WalletSettingsStore extends Store<StoresMap, ActionsMap> {
}
await removeWalletFromLS(request.publicDeriver)

// remove this wallet from wallet sort list
// Remove this wallet from wallet sort list
const walletType = getWalletType(request.publicDeriver)
const walletsNavigation = this.stores.profile.walletsNavigation
const newWalletsNavigation = {
Expand All @@ -285,9 +285,22 @@ export default class WalletSettingsStore extends Store<StoresMap, ActionsMap> {
[walletType]: walletsNavigation[walletType].filter(
walletId => walletId !== request.publicDeriver.publicDeriverId)
}

await this.actions.profile.updateSortedWalletList.trigger(newWalletsNavigation);

// ==================== Disconnect related dApps ====================
await this.actions.connector.getConnectorWhitelist.trigger();
const connectorWhitelist = this.stores.connector.currentConnectorWhitelist;
const connectedDapps = connectorWhitelist.filter(
dapp => dapp.publicDeriverId === request.publicDeriver.publicDeriverId
);

for (const dapp of connectedDapps) {
await this.actions.connector.removeWalletFromWhitelist.trigger({
protocol: dapp.protocol,
url: dapp.url,
});
}

await this.removeWalletRequest.execute({
publicDeriver: request.publicDeriver,
conceptualWallet: group.publicDerivers.length === 1
Expand Down

0 comments on commit be6bb81

Please sign in to comment.