diff --git a/src/wallet-service.tsx b/src/wallet-service.tsx index d3265e3..33e3771 100644 --- a/src/wallet-service.tsx +++ b/src/wallet-service.tsx @@ -107,6 +107,21 @@ export const WalletServiceProvider = props => { ); }, []); + // updated active publicKey when wallet unlocked + useEffect(() => { + getActivePublicKey() + .then(key => { + setActivePublicKey(key); + console.log(key); + }) + .catch(err => { + if (err.code === 2) { + setActivePublicKey(null); + } + // no op + }); + }, [extensionLoaded,setActivePublicKey]); + // WALLET SUBSCRIPTIONS useEffect(() => { if (extensionLoaded === false) {