Skip to content

Commit

Permalink
fix balance poll if extension account select is aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Nov 7, 2024
1 parent b139a81 commit ebce976
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/ui/ChooseWalletOverlay.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<OverlayDialog :show="show" :close="close" title="Access Your Wallet!">
<OverlayDialog :show="show" :close="closeProxy" title="Access Your Wallet!">
<div class="mt-2">
<div v-if="hasCreateTestingAccountFn" class="mt-4">
<p class="text-sm text-gray-400">How would you like to connect?</p>
Expand Down Expand Up @@ -129,6 +129,15 @@ const hasCreateTestingAccountFn = computed(
() => typeof props.createTestingAccount === "function",
);
// even if the same account stays selected and the overlay is manually closed
// we need to call onExtensionAccountChange. otherwise the balance poll will wait forever
const closeProxy = () => {
if (selectedExtensionAccount.value) {
props.onExtensionAccountChange(selectedExtensionAccount.value);
}
props.close();
};
watch(selectedExtensionAccount, async (selectedAddress) => {
if (selectedAddress) {
props.onExtensionAccountChange(selectedAddress);
Expand Down

0 comments on commit ebce976

Please sign in to comment.