Simplify handlers & IPC client: move from Result pattern to throwing errors (#120)

This commit is contained in:
Will Chen
2025-05-09 15:14:12 -07:00
committed by GitHub
parent 26305ee090
commit c71638a508
25 changed files with 618 additions and 990 deletions

View File

@@ -4,11 +4,13 @@ import { writeSettings } from "../../main/settings";
import { readSettings } from "../../main/settings";
export function registerSettingsHandlers() {
// Intentionally do NOT use handle because it could log sensitive data from the return value.
ipcMain.handle("get-user-settings", async () => {
const settings = readSettings();
return settings;
});
// Intentionally do NOT use handle because it could log sensitive data from the args.
ipcMain.handle(
"set-user-settings",
async (_, settings: Partial<UserSettings>) => {