update directory live
Some checks are pending
Build Electron App / build (macos-latest, build:mac) (push) Waiting to run
Build Electron App / build (ubuntu-latest, build:linux) (push) Waiting to run
Build Electron App / build (windows-latest, build:win) (push) Waiting to run

This commit is contained in:
nicwands
2026-03-03 17:21:14 -05:00
parent e9e0abe380
commit 73349444d6
16 changed files with 88339 additions and 39075 deletions

View File

@@ -333,11 +333,26 @@ app.whenReady().then(async () => {
"729a0d21d783654c68f1a0123e2a0e986350de536b5324f1f35876ea12ffeaf5"
);
await notesAPI.init();
ipcMain.handle("notesAPI:call", (_, method, args) => {
const broadcastNoteChange = (event, data) => {
BrowserWindow.getAllWindows().forEach((win) => {
win.webContents.send(event, data);
});
};
ipcMain.handle("notesAPI:call", async (_, method, args) => {
if (!notesAPI[method]) {
throw new Error("Invalid method");
}
return notesAPI[method](...args);
const result = await notesAPI[method](...args);
if (method === "createNote") {
broadcastNoteChange("note-created", result);
} else if (method === "updateNote") {
broadcastNoteChange("note-updated", result);
} else if (method === "updateNoteMetadata") {
broadcastNoteChange("note-updated", result);
} else if (method === "deleteNote") {
broadcastNoteChange("note-deleted", { id: args[0] });
}
return result;
});
electronApp.setAppUserModelId("com.electron");
app.on("browser-window-created", (_, window) => {