Skip to content

Commit 05f7239

Browse files
committed
fix: window.capacitorFetch being undefined instantly after load
1 parent 1d81557 commit 05f7239

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/main.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ import { isMobilePlatform } from "./utils/os";
4141
/* Vue store */
4242
const pinia = createPinia();
4343

44-
if (__IS_ELECTRON__) {
45-
await import("./electron");
46-
} else if (isMobilePlatform()) {
47-
void import("./mobile");
44+
async function main(): Promise<void> {
45+
if (__IS_ELECTRON__) {
46+
await import("./electron");
47+
} else if (isMobilePlatform()) {
48+
await import("./mobile");
49+
}
50+
51+
const app = createApp(App).use(IonicVue).use(pinia).use(router);
52+
53+
await router.isReady().then(() => {
54+
app.mount("#app");
55+
});
4856
}
4957

50-
const app = createApp(App).use(IonicVue).use(pinia).use(router);
51-
52-
void router.isReady().then(() => {
53-
app.mount("#app");
54-
});
58+
void main();

0 commit comments

Comments
 (0)