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 {
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>