diff --git a/components/overlays/SessionProxiesOverlay.vue b/components/overlays/SessionProxiesOverlay.vue index 77b655e..e3d2c45 100644 --- a/components/overlays/SessionProxiesOverlay.vue +++ b/components/overlays/SessionProxiesOverlay.vue @@ -273,6 +273,9 @@ const modifySessionProxyRole = async ( " expiry update to: " + expiry, ); + // clear the cached proxy entry at old role. it will be added again with the new role + // at the next fetchIncogniteeBalance + accountStore.removeProxyForRole(bestSessionProxyRole.value); const nonce = new u32( new TypeRegistry(), accountStore.nonce[incogniteeSidechain.value], @@ -360,6 +363,12 @@ watch( isSignerBusy.value = false; [bestSessionProxy.value, bestSessionProxyRole.value] = accountStore.sessionProxyBest(); + console.log( + "best session proxy: ", + bestSessionProxy.value.address, + " role: ", + bestSessionProxyRole.value, + ); if (bestSessionProxyRole.value !== null) { selectedSessionProxyRole.value = bestSessionProxyRole.value; } else { diff --git a/store/account.ts b/store/account.ts index 575de1f..2f3a595 100644 --- a/store/account.ts +++ b/store/account.ts @@ -201,6 +201,10 @@ export const useAccount = defineStore("account", { this.sessionProxies[role] = sessionProxy; this.sessionProxySeeds[sessionProxy] = seed; }, + removeProxyForRole(role: SessionProxyRole) { + delete this.sessionProxies[role]; + delete this.sessionProxySeeds[role]; + }, setBalanceFree(balance: BigInt, chain: ChainId) { this.balanceFree[chain] = balance; },