fix db connection

This commit is contained in:
an-lee
2024-09-08 21:53:35 +08:00
parent 1a3e9a7ec0
commit 974b07fdcc

View File

@@ -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 {