From 403bd627a8dc2fac81cd3509ca160067797d2e67 Mon Sep 17 00:00:00 2001 From: Lukasz Kosiak Date: Thu, 23 Apr 2026 11:08:48 +0200 Subject: [PATCH 1/4] feat: enhance account modal with EVM support and update account display logic --- .../src/components/Modal/Account.vue | 19 ++++++++++++++++--- .../src/store/modules/web3.ts | 10 ++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/products/governance-snapshot/src/components/Modal/Account.vue b/products/governance-snapshot/src/components/Modal/Account.vue index d3d1df404..903feb9dc 100644 --- a/products/governance-snapshot/src/components/Modal/Account.vue +++ b/products/governance-snapshot/src/components/Modal/Account.vue @@ -33,7 +33,7 @@

Account

@@ -43,8 +43,7 @@ size="16" class="mr-2 ml-n1" /> - - + @@ -70,6 +69,20 @@ export default { step: null }; }, + computed: { + accountDisplayAddress() { + if (this.web3.isEVM) { + return '0x' + this.web3.account.base16; + } + return this.web3.account.bech32; + }, + accountExplorerUrl() { + if (this.web3.isEVM) { + return `https://zilliqa.blockscout.com/address/0x${this.web3.account.base16}`; + } + return this._explorer(this.web3.network.name, this.web3.account.bech32); + } + }, watch: { open() { this.step = null; diff --git a/products/governance-snapshot/src/store/modules/web3.ts b/products/governance-snapshot/src/store/modules/web3.ts index 8b8d4b995..da2ff537b 100644 --- a/products/governance-snapshot/src/store/modules/web3.ts +++ b/products/governance-snapshot/src/store/modules/web3.ts @@ -19,13 +19,15 @@ const state = { bech32: '' }, name: null, - network: config.networks['mainnet'] + network: config.networks['mainnet'], + isEVM: false }; const mutations = { LOGOUT(_state) { Vue.set(_state, 'account', null); Vue.set(_state, 'name', null); + Vue.set(_state, 'isEVM', false); console.debug('LOGOUT'); }, LOAD_PROVIDER_REQUEST() { @@ -57,6 +59,9 @@ const mutations = { HANDLE_ACCOUNTS_CHANGED(_state, payload) { Vue.set(_state, 'account', payload); console.debug('HANDLE_ACCOUNTS_CHANGED', payload); + }, + SET_IS_EVM(_state, value: boolean) { + Vue.set(_state, 'isEVM', value); } }; @@ -82,7 +87,8 @@ const actions = { const base16 = auth.provider.address.slice(2).toLowerCase(); const bech32 = toBech32Address('0x' + base16); commit('HANDLE_CHAIN_CHANGED', 'mainnet'); - commit('LOAD_PROVIDER_SUCCESS', { account: { base16, bech32 }, name: bech32 }); + commit('SET_IS_EVM', true); + commit('LOAD_PROVIDER_SUCCESS', { account: { base16, bech32 }, name: '0x' + base16 }); // Subscribe to future account changes (e.g. user switches wallet in MetaMask) window['ethereum'].on('accountsChanged', (accounts: string[]) => { From 781ba00b562d4dc32fa55cb125292de56dfab86d Mon Sep 17 00:00:00 2001 From: Lukasz Kosiak Date: Thu, 23 Apr 2026 11:23:37 +0200 Subject: [PATCH 2/4] feat: add disconnect button to account modal and fix EVM wallet logout - Add Disconnect button to the Account modal (was permanently hidden via v-show="!web3") - Fix LOGOUT and LOAD_PROVIDER_FAILURE mutations to reset account to empty object instead of null, preventing null-dereference crashes in templates - Await $auth.logout() before committing LOGOUT to avoid a race condition where account becomes null while isAuthenticated is still true - Remove unused "Connect wallet" button from the account view and clean up dead step data property and watcher Co-Authored-By: Claude Sonnet 4.6 --- .../src/components/Modal/Account.vue | 19 ++++--------------- .../src/store/modules/web3.ts | 6 +++--- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/products/governance-snapshot/src/components/Modal/Account.vue b/products/governance-snapshot/src/components/Modal/Account.vue index 903feb9dc..853280e08 100644 --- a/products/governance-snapshot/src/components/Modal/Account.vue +++ b/products/governance-snapshot/src/components/Modal/Account.vue @@ -1,6 +1,6 @@