From df57896e2b1f0fc3f2786a5b7e2476575eefdfb0 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 26 Sep 2024 12:48:40 -0700 Subject: [PATCH] Dispose of the window DB entry when no tabs are left (#866) Fixes issue where closing the last tab in the last window would cause app to show a blank window the next time it opens. Instead, we should dispose of the window so that it can be created from scratch the next time the app launches. Also fixes a potential DB resource leak from dead windows cluttering up the DB --- pkg/service/windowservice/windowservice.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/service/windowservice/windowservice.go b/pkg/service/windowservice/windowservice.go index 883a5b670..6e1a9a2a8 100644 --- a/pkg/service/windowservice/windowservice.go +++ b/pkg/service/windowservice/windowservice.go @@ -76,6 +76,7 @@ func (svc *WindowService) CloseTab(ctx context.Context, uiContext waveobj.UICont } if window.ActiveTabId == tabId && tabIndex != -1 { if len(ws.TabIds) == 1 { + svc.CloseWindow(ctx, uiContext.WindowId) eventbus.SendEventToElectron(eventbus.WSEventType{ EventType: eventbus.WSEvent_ElectronCloseWindow, Data: uiContext.WindowId,