this
doesn't work in strict mode which the SDK is exported as
See https://github.com/vector-im/hydrogen-web/pull/373/files#r927145321
This commit is contained in:
parent
871cf1ad80
commit
c824012968
1 changed files with 4 additions and 5 deletions
|
@ -34,12 +34,11 @@ interface ServiceWorkerHandler {
|
||||||
|
|
||||||
async function requestPersistedStorage(): Promise<boolean> {
|
async function requestPersistedStorage(): Promise<boolean> {
|
||||||
// don't assume browser so we can run in node with fake-idb
|
// don't assume browser so we can run in node with fake-idb
|
||||||
const glob = this;
|
if (window?.navigator?.storage?.persist) {
|
||||||
if (glob?.navigator?.storage?.persist) {
|
return await window.navigator.storage.persist();
|
||||||
return await glob.navigator.storage.persist();
|
} else if (window?.document.requestStorageAccess) {
|
||||||
} else if (glob?.document.requestStorageAccess) {
|
|
||||||
try {
|
try {
|
||||||
await glob.document.requestStorageAccess();
|
await window.document.requestStorageAccess();
|
||||||
return true;
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Reference in a new issue