taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 68c8bd2d13143ff2dba3c0b19f40e115710becb5
parent 6f6458b77984ce44904f05e2c988c39846968b14
Author: Sebastian <sebasjm@gmail.com>
Date:   Sat, 27 Jul 2024 15:21:11 -0300

fixing current tab

Diffstat:
Mpackages/taler-wallet-webextension/src/components/WalletActivity.tsx | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/components/WalletActivity.tsx b/packages/taler-wallet-webextension/src/components/WalletActivity.tsx @@ -723,9 +723,14 @@ let currentTab: chrome.tabs.Tab | undefined; // Allow running outside the extension for testing // tslint:disable-next-line:no-string-literal if (typeof chrome !== "undefined") { - chrome.tabs.getCurrent().then((d) => { - currentTab = d; - }); + const p = chrome.tabs.getCurrent(); + // this may be called outside the render phase (in the background) + // when this happen currentTab is not needed but also undefined + if (p) { + p.then((d) => { + currentTab = d; + }); + } } export function ObservabilityEventsTable(): VNode {