/** * Work around Safari 14 IndexedDB open bug. * * Safari has a horrible bug where IDB requests can hang while the browser is starting up. https://bugs.webkit.org/show_bug.cgi?id=226547 * The only solution is to keep nudging it until it's awake. */ exportdefaultfunctionidbReady(): Promise<void> { const isSafari = !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent);
// No point putting other browsers or older versions of Safari through this mess. if (!isSafari || !indexedDB.databases) returnPromise.resolve();