Skip to content

Commit

Permalink
ask browser for storage persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Nov 8, 2023
1 parent 0b9a2b2 commit 07ca81a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/logic/mutinyWalletSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 07ca81a

Please sign in to comment.