diff --git a/enjoy/src/main/db/index.ts b/enjoy/src/main/db/index.ts index f972d656..1efc47d8 100644 --- a/enjoy/src/main/db/index.ts +++ b/enjoy/src/main/db/index.ts @@ -216,6 +216,13 @@ db.disconnect = async () => { db.registerIpcHandlers = () => { ipcMain.handle("db-connect", async () => { + if (db.isConnecting) + return { + state: "connecting", + path: settings.dbPath(), + error: null, + }; + try { await db.connect(); return {