From 519d6b850e07a0387511a8f024dc394250b1a241 Mon Sep 17 00:00:00 2001 From: Clawd Date: Sat, 28 Feb 2026 15:26:02 -0800 Subject: Clear artifacts when creating new session Each new session now starts with empty research.md and plan.md files, preventing stale content from previous sessions appearing. --- dist/main/index.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 dist/main/index.js (limited to 'dist/main/index.js') diff --git a/dist/main/index.js b/dist/main/index.js new file mode 100644 index 0000000..a10a371 --- /dev/null +++ b/dist/main/index.js @@ -0,0 +1,54 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const electron_1 = require("electron"); +const node_path_1 = __importDefault(require("node:path")); +const db_1 = require("./db"); +const handlers_1 = require("./ipc/handlers"); +const isDev = !electron_1.app.isPackaged; +let mainWindow = null; +function createWindow() { + mainWindow = new electron_1.BrowserWindow({ + width: 1400, + height: 900, + minWidth: 1000, + minHeight: 600, + show: false, + titleBarStyle: "hiddenInset", + webPreferences: { + contextIsolation: true, + nodeIntegration: false, + preload: node_path_1.default.join(__dirname, "preload.js"), + }, + }); + (0, handlers_1.registerIpcHandlers)(mainWindow); + if (isDev) { + const url = process.env.VITE_DEV_SERVER_URL ?? "http://localhost:5173"; + mainWindow.loadURL(url).finally(() => { + mainWindow.show(); + mainWindow.webContents.openDevTools({ mode: "detach" }); + }); + } + else { + const indexHtml = node_path_1.default.join(electron_1.app.getAppPath(), "renderer", "dist", "index.html"); + mainWindow.loadFile(indexHtml).finally(() => mainWindow.show()); + } +} +electron_1.app.whenReady().then(() => { + // Initialize database + (0, db_1.getDb)(); + createWindow(); + electron_1.app.on("activate", () => { + if (electron_1.BrowserWindow.getAllWindows().length === 0) { + createWindow(); + } + }); +}); +electron_1.app.on("window-all-closed", () => { + (0, db_1.closeDb)(); + if (process.platform !== "darwin") { + electron_1.app.quit(); + } +}); -- cgit v1.2.3