mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
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
This commit is contained in:
parent
de92e53c38
commit
df57896e2b
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user