From b3d7fcc1fa1779751908533f34aea395dd5de4ac Mon Sep 17 00:00:00 2001 From: kevodwyer Date: Wed, 26 Jul 2023 14:37:45 +0100 Subject: [PATCH] up safari storage to 700MiB --- vendor/priors/gwt.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/vendor/priors/gwt.js b/vendor/priors/gwt.js index 0ab7fc12..9b1cd770 100644 --- a/vendor/priors/gwt.js +++ b/vendor/priors/gwt.js @@ -518,7 +518,7 @@ var batStoreCache; var accountStoreCache; var pkiStoreCache; var rootKeyCache; -let SAFARI_CACHE_SIZE = 1024 * 1024 * 200; +let SAFARI_CACHE_SIZE = 1024 * 1024 * 700; function bindCacheStore(storeCache) { blockStoreCache = storeCache; @@ -534,17 +534,15 @@ function getCurrentDesiredCacheSize() { } function getDesiredCacheSize() { let future = peergos.shared.util.Futures.incomplete(); - if (isSafariTest()) { - future.complete(SAFARI_CACHE_SIZE); - } else { - getIDBKV("desiredSize", blockStoreCache.cacheDesiredSizeStore).then((val) => { - if (val == null) { - future.complete(-1); - } else { - future.complete(val); - } - }); - } + getIDBKV("desiredSize", blockStoreCache.cacheDesiredSizeStore).then((val) => { + if (val == null || val == -1) { + future.complete(-1); + } else if(val == 0 && isSafariTest()) { + future.complete(SAFARI_CACHE_SIZE); + } else { + future.complete(val); + } + }); return future; } function setDesiredCacheSize(desiredSize) {