Skip to content

Enhance account modal with EVM support and improve logout functionality#775

Merged
lukozill merged 4 commits intomainfrom
users/lukasz/governance_portal_improvements
Apr 23, 2026
Merged

Enhance account modal with EVM support and improve logout functionality#775
lukozill merged 4 commits intomainfrom
users/lukasz/governance_portal_improvements

Conversation

@lukozill
Copy link
Copy Markdown
Contributor

Description

This addresses the requests from GZil committee by improving the governance portal account modal with EVM wallet support and fixes for wallet disconnection.

EVM wallet support (Modal/Account.vue)

  • The account address and block explorer link now correctly display and link for EVM wallets (MetaMask). EVM addresses are shown with the 0x prefix and link to Blockscout; ZilPay addresses continue to use bech32 format and link to ViewBlock.
  • The Vuex store gains an isEVM flag (toggled by a new SET_IS_EVM mutation) so components can distinguish between wallet types, and the flag is cleared on logout.

Wallet disconnection (Modal/Account.vue, web3.ts)

  • Replaces the permanently-hidden "Connect wallet" button (rendered with v-show="!web3", which was always false) with a functional Disconnect button.
  • Fixes a race condition in the logout store action: $auth.logout() is now awaited before LOGOUT is committed, so isAuthenticated becomes false before account is reset — preventing a cycle where authenticated templates render against a cleared account.
  • LOGOUT and LOAD_PROVIDER_FAILURE mutations now reset account to { base16: '', bech32: '' } (matching the initial state) instead of null, eliminating null-dereference crashes in templates that access web3.account.base16 / web3.account.bech32 unconditionally (e.g. Topnav's :key binding).

Testing

Tested locally using docker compose setup.

lukozill and others added 2 commits April 23, 2026 11:08
- 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 <noreply@anthropic.com>
@lukozill lukozill enabled auto-merge (squash) April 23, 2026 09:33
Comment thread products/governance-snapshot/src/store/modules/web3.ts Outdated
Comment thread products/governance-snapshot/src/components/Modal/Account.vue
frankmeds
frankmeds previously approved these changes Apr 23, 2026
Wrap $auth.logout() in try/catch/finally so LOGOUT commit always runs
even if the provider rejects, and dispatch a red notification on failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nce-snapshot README

The governance portal is scheduled for deprecation and testnet will not
be supported. Documents the known limitation that EVM wallet explorer links
are hardcoded to zilliqa.blockscout.com (mainnet).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lukozill lukozill merged commit 990c8a2 into main Apr 23, 2026
3 checks passed
@lukozill lukozill deleted the users/lukasz/governance_portal_improvements branch April 23, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants