diff --git a/mikupad.html b/mikupad.html index 839ea68..13d6537 100644 --- a/mikupad.html +++ b/mikupad.html @@ -4781,17 +4781,15 @@ const persistent = await navigator.storage.persist(); const elapsedTime = performance.now() - startTime; - if (!persistent) { - // If the response came back in less than 200ms, it was likely an automatic denial - // (200ms is generally considered faster than human reaction time) - if (elapsedTime < 200) { - if (!localStorage.getItem('persistentStorageWarningShown')) { - alert('Your browser has automatically denied persistent storage for Mikupad. Be aware that the browser may clear the database when under storage pressure. You might need to adjust your browser settings to enable this feature, or alternatively, you can use the Mikupad server.'); - localStorage.setItem('persistentStorageWarningShown', 'true'); - } + if (!persistent && !localStorage.getItem('persistentStorageWarningShown')) { + // If the response came back in less than 500ms, it was likely an automatic denial + // (500ms is generally considered faster than human reaction time) + if (elapsedTime < 500) { + alert('Your browser has automatically denied persistent storage for Mikupad. Be aware that the browser may clear the database when under storage pressure. You might need to adjust your browser settings to enable this feature, or alternatively, you can use the Mikupad server.'); } else { alert('You have chosen not to enable persistent storage for Mikupad. Be aware that the browser may clear the database when under storage pressure. As an optional alternative, you can use the Mikupad server.'); } + localStorage.setItem('persistentStorageWarningShown', 'true'); } } } catch {}