ask browser for storage persistence

This commit is contained in:
Paul Miller
2023-11-08 15:01:41 -06:00
parent 0b9a2b2595
commit 07ca81a5e6

View File

@@ -197,6 +197,22 @@ export async function setupMutinyWallet(
): Promise<MutinyWallet> {
console.log("Starting setup...");
// https://developer.mozilla.org/en-US/docs/Web/API/Storage_API
// Ask the browser to not clear storage
if (navigator.storage && navigator.storage.persist) {
navigator.storage.persist().then((persistent) => {
if (persistent) {
console.log(
"Storage will not be cleared except by explicit user action"
);
} else {
console.log(
"Storage may be cleared by the UA under storage pressure."
);
}
});
}
const {
network,
proxy,