mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-22 07:34:20 +01:00
ask browser for storage persistence
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user