2021-06-20 09:48:44 -07:00
|
|
|
import safariIdbReady from 'safari-14-idb-fix'
|
2021-07-04 20:19:04 -07:00
|
|
|
import { isWebKit } from './userAgent/isWebKit.js'
|
2021-06-20 09:48:44 -07:00
|
|
|
|
|
|
|
// 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()
|
|
|
|
}
|