commit 7a27da5fba288e39d744f0b70419b38e3f29aa87
parent ced02d1fed4571302423d09e506623a703893d45
Author: Florian Dold <florian@dold.me>
Date: Tue, 8 Mar 2022 23:26:02 +0100
webextension: close popup
only seems to work with callbacks, not with promises
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
@@ -172,15 +172,16 @@ function Application(): VNode {
function RedirectToWalletPage(): VNode {
const page = document.location.hash || "#/";
useEffect(() => {
- chrome.tabs
- .create({
+ chrome.tabs.create(
+ {
active: true,
// eslint-disable-next-line no-undef
url: chrome.runtime.getURL(`/static/wallet.html${page}`),
- })
- .then(() => {
+ },
+ () => {
window.close();
- });
+ },
+ );
});
return (
<span>