Use Persistent Storage where possible
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
12eb408c58
commit
ffde11ca91
3 changed files with 32 additions and 0 deletions
|
@ -43,6 +43,16 @@ function track(action) {
|
|||
Analytics.trackEvent("StorageManager", action);
|
||||
}
|
||||
|
||||
export function tryPersistStorage() {
|
||||
if (navigator.storage && navigator.storage.persist) {
|
||||
navigator.storage.persist().then(persistent => {
|
||||
console.log("StorageManager: Persistent?", persistent);
|
||||
});
|
||||
} else {
|
||||
console.log("StorageManager: Persistence unsupported");
|
||||
}
|
||||
}
|
||||
|
||||
export async function checkConsistency() {
|
||||
log("Checking storage consistency");
|
||||
log(`Local storage supported? ${!!localStorage}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue