Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 84c535a

Browse files
committed
electron: Fix "Cannot access 'sqlInit' before initialization" at startup
1 parent e5cdccc commit 84c535a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/becca/becca_loader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import sql from "../services/sql.js";
44
import eventService from "../services/events.js";
55
import becca from "./becca.js";
6-
import sqlInit from "../services/sql_init.js";
76
import log from "../services/log.js";
87
import BNote from "./entities/bnote.js";
98
import BBranch from "./entities/bbranch.js";
@@ -17,7 +16,8 @@ import AbstractBeccaEntity from "./entities/abstract_becca_entity.js";
1716
import options_init from "../services/options_init.js";
1817
import ws from "../services/ws.js";
1918

20-
const beccaLoaded = new Promise<void>((res, rej) => {
19+
const beccaLoaded = new Promise<void>(async (res, rej) => {
20+
const sqlInit = (await import("../services/sql_init.js")).default;
2121
sqlInit.dbReady.then(() => {
2222
cls.init(() => {
2323
load();

0 commit comments

Comments
 (0)