Commit 5593885 1 parent b81b34d commit 5593885 Copy full SHA for 5593885
File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -89,16 +89,16 @@ export default class MetaMask extends AbstractWallet {
89
89
if ( ! ( this . constructor as typeof MetaMask ) . isInterfaceReady ) {
90
90
return ;
91
91
}
92
- window . ethereum . on ( 'accountsChanged' , this . accountsChangedHandler ) ;
93
- window . ethereum . on ( 'chainChanged' , this . networkChangedHandler ) ;
92
+ window . ethereum . on ( 'accountsChanged' , this . accountsChangedHandler . bind ( this ) ) ;
93
+ window . ethereum . on ( 'chainChanged' , this . networkChangedHandler . bind ( this ) ) ;
94
94
}
95
95
96
96
public teardown ( ) {
97
97
if ( ! ( this . constructor as typeof MetaMask ) . isInterfaceReady ) {
98
98
return ;
99
99
}
100
100
window . $nuxt . $store . dispatch ( 'network/setWalletChainId' , undefined ) ;
101
- window . ethereum . removeListener ( 'accountsChanged' , this . accountsChangedHandler ) ;
102
- window . ethereum . removeListener ( 'chainChanged' , this . networkChangedHandler ) ;
101
+ window . ethereum . removeListener ( 'accountsChanged' , this . accountsChangedHandler . bind ( this ) ) ;
102
+ window . ethereum . removeListener ( 'chainChanged' , this . networkChangedHandler . bind ( this ) ) ;
103
103
}
104
104
}
You can’t perform that action at this time.
0 commit comments