mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-18 20:19:30 -07:00
fix(main.ts): change import statements to use import then syntax instead of top layer await to improve compatibility with Firefox and Chromium browsers
This commit is contained in:
@@ -9,12 +9,14 @@ const ijs = initResources()
|
|||||||
initState(ijs.length)
|
initState(ijs.length)
|
||||||
initNav()
|
initNav()
|
||||||
|
|
||||||
|
// NOTE: it seems firefox and chromnium don't like top layer await
|
||||||
|
// so we are using import then instead
|
||||||
if (ijs.length > 0) {
|
if (ijs.length > 0) {
|
||||||
if (!isMobile()) {
|
if (!isMobile()) {
|
||||||
const d = await import('./desktop/init')
|
import('./desktop/init')
|
||||||
d.initDesktop(ijs)
|
.then((d) => d.initDesktop(ijs))
|
||||||
|
.catch((e) => console.log(e))
|
||||||
} else {
|
} else {
|
||||||
const m = await import('./mobile/init')
|
import('./mobile/init').then((m) => m.initMobile(ijs)).catch((e) => console.log(e))
|
||||||
m.initMobile(ijs)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user