diff --git a/utils.js b/utils.js index b3b285e429..6593780220 100644 --- a/utils.js +++ b/utils.js @@ -191,19 +191,25 @@ window.addEventListener('offline', () => { isOffline = true }); let isPersistStorage = false; -if (navigator.storage && navigator.storage.persist) { +async function checkPersistStorage() { - isPersistStorage = await navigator.storage.persisted(); - - if (!isPersistStorage) { - - // request persistent storage - isPersistStorage = await navigator.storage.persist(); - + if (navigator.storage && navigator.storage.persist) { + + isPersistStorage = await navigator.storage.persisted(); + + if (!isPersistStorage) { + + // request persistent storage + isPersistStorage = await navigator.storage.persist(); + + } + } } +checkPersistStorage(); + // base64 encode/decode diff --git a/worker/client-channel.js b/worker/client-channel.js index 4c479e9811..1c0b0f256d 100644 --- a/worker/client-channel.js +++ b/worker/client-channel.js @@ -4,7 +4,7 @@ // update worker name when updating worker -const WORKER_NAME = 'codeit-worker-v492'; +const WORKER_NAME = 'codeit-worker-v493'; // internal paths