fix: update usage of safari-14-idb-fix (#2072)

* chore: update deps

* fix: fix dep path

* fix: fix import

* fix: fix pkg
This commit is contained in:
Nolan Lawson 2021-07-16 07:42:32 -07:00 committed by GitHub
parent d30f7f4b1a
commit 821b785e6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View file

@ -6,7 +6,7 @@ import './routes/_utils/forceOnline.js'
import { mark, stop } from './routes/_utils/marks.js' import { mark, stop } from './routes/_utils/marks.js'
import { loadPolyfills } from './routes/_utils/polyfills/loadPolyfills.js' import { loadPolyfills } from './routes/_utils/polyfills/loadPolyfills.js'
import { loadNonCriticalPolyfills } from './routes/_utils/polyfills/loadNonCriticalPolyfills.js' import { loadNonCriticalPolyfills } from './routes/_utils/polyfills/loadNonCriticalPolyfills.js'
import { idbReady } from './routes/_utils/idbReady.js' import idbReady from 'safari-14-idb-fix/dist/esm'
Promise.all([idbReady(), loadPolyfills()]).then(() => { Promise.all([idbReady(), loadPolyfills()]).then(() => {
mark('sapperStart') mark('sapperStart')

View file

@ -1,14 +0,0 @@
import safariIdbReady from 'safari-14-idb-fix'
import { isWebKit } from './userAgent/isWebKit.js'
// workaround for a safari 14 bug, see https://github.com/jakearchibald/safari-14-idb-fix
export async function idbReady () {
if (!isWebKit()) {
return
}
if (typeof indexedDB === 'undefined' || !indexedDB.databases) {
// fix for https://github.com/jakearchibald/safari-14-idb-fix/pull/2
return
}
await safariIdbReady()
}