From 732f4c529460f52adba338b6c0e508f6d7abd33c Mon Sep 17 00:00:00 2001 From: yushi Date: Wed, 7 Jul 2021 02:44:14 +0800 Subject: [PATCH 1/2] check for action existence --- .../app/stores/toplevel/TokenInfoStore.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js b/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js index a7e75f682f..158e026526 100644 --- a/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js +++ b/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js @@ -40,9 +40,12 @@ export default class TokenInfoStore extends Store { setup(): void { super.setup(); this.tokenInfo = new Map(); - this.actions.wallets.setActiveWallet.listen( - wallet => { this._fetchMissingTokenInfo(wallet) } - ); + // the Ergo connector doesn't have this action + if (this.actions.wallets?.setActiveWallet) { + this.actions.wallets.setActiveWallet.listen( + wallet => { this._fetchMissingTokenInfo(wallet) } + ); + } } @action _fetchMissingTokenInfo From 447a14a03cffda797216115bcf5cf523fa9b7cd5 Mon Sep 17 00:00:00 2001 From: vantuz-subhuman Date: Wed, 7 Jul 2021 00:57:41 +0300 Subject: [PATCH 2/2] Flow --- packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js b/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js index 158e026526..4f360b5d45 100644 --- a/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js +++ b/packages/yoroi-extension/app/stores/toplevel/TokenInfoStore.js @@ -41,7 +41,7 @@ export default class TokenInfoStore extends Store { super.setup(); this.tokenInfo = new Map(); // the Ergo connector doesn't have this action - if (this.actions.wallets?.setActiveWallet) { + if (this.actions.wallets.setActiveWallet) { this.actions.wallets.setActiveWallet.listen( wallet => { this._fetchMissingTokenInfo(wallet) } );