((resolve, reject) => {
// We set permissions here, since apparently FF wants this to be done
// as the result of an input event ...
getPermissionsApi().request(extendedPermissions, (granted: boolean) => {
if (chrome.runtime.lastError) {
console.error("error requesting permissions");
console.error(chrome.runtime.lastError);
reject(chrome.runtime.lastError);
return;
}
console.log("permissions granted:", granted);
resolve(granted);
});
});
const res = await wxApi.setExtendedPermissions(granted);
nextVal = res.newValue;
} else {
const res = await wxApi.setExtendedPermissions(false);
nextVal = res.newValue;
}
console.log("new permissions applied:", nextVal ?? false);
return nextVal ?? false
}
export function Welcome(): JSX.Element {
const [permissionsEnabled, togglePermissions] = useExtendedPermissions()
return (
<>
Thank you for installing the wallet.
Permissions
Next Steps
Try the demo »
Learn how to top up your wallet balance »
>
);
}
/**
* @deprecated to be removed
*/
export function createWelcomePage(): JSX.Element {
return ;
}