From a60e2fc7610f2a5f40c2322d856a8858bffb1af6 Mon Sep 17 00:00:00 2001 From: Wendy Tang Date: Tue, 25 Mar 2025 12:04:52 -0700 Subject: [PATCH] fix: show window bugfix (#1840) --- ui/desktop/src/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index ae407f51..f3efdfd6 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -278,11 +278,14 @@ const createTray = () => { tray.setContextMenu(contextMenu); }; -const showWindow = () => { +const showWindow = async () => { const windows = BrowserWindow.getAllWindows(); if (windows.length === 0) { - log.info('No windows are currently open.'); + log.info('No windows are open, creating a new one...'); + const recentDirs = loadRecentDirs(); + const openDir = recentDirs.length > 0 ? recentDirs[0] : null; + await createChat(app, undefined, openDir); return; }