webextension: close popup

only seems to work with callbacks, not with promises
This commit is contained in:
Florian Dold 2022-03-08 23:26:02 +01:00
parent ced02d1fed
commit 7a27da5fba
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -172,15 +172,16 @@ function Application(): VNode {
function RedirectToWalletPage(): VNode { function RedirectToWalletPage(): VNode {
const page = document.location.hash || "#/"; const page = document.location.hash || "#/";
useEffect(() => { useEffect(() => {
chrome.tabs chrome.tabs.create(
.create({ {
active: true, active: true,
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
url: chrome.runtime.getURL(`/static/wallet.html${page}`), url: chrome.runtime.getURL(`/static/wallet.html${page}`),
}) },
.then(() => { () => {
window.close(); window.close();
}); },
);
}); });
return ( return (
<span> <span>