Problem: For a user who has installed MetaMask and opened the Validators DApp for the first time in the current browser's session, the DApp asks permissions to get access to the list of accounts in MetaMask. But the app doesn't need to know the list of user's accounts until validator's Voting Key is really needed for some operation.
Solution: call window.ethereum.enable only when DApp requires Voting Key to take some action which supposes transaction signing (when the user goes to Set Metadata page or wants to Confirm/Finalize on Pending Changes page).
Problem: For a user who has installed MetaMask and opened the Validators DApp for the first time in the current browser's session, the DApp asks permissions to get access to the list of accounts in MetaMask. But the app doesn't need to know the list of user's accounts until validator's
Voting Key
is really needed for some operation.Solution: call
window.ethereum.enable
only when DApp requiresVoting Key
to take some action which supposes transaction signing (when the user goes toSet Metadata
page or wants toConfirm/Finalize
onPending Changes
page).