Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions emain/emain-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ export class WaveBrowserWindow extends BaseWindow {
}

async switchWorkspace(workspaceId: string) {
console.log("switchWorkspace", workspaceId, this.waveWindowId);
const curWorkspace = await WorkspaceService.GetWorkspace(this.workspaceId);
if (curWorkspace.tabids.length > 1 && (!curWorkspace.name || !curWorkspace.icon)) {
const choice = dialog.showMessageBoxSync(this, {
Expand Down Expand Up @@ -270,16 +271,16 @@ export class WaveBrowserWindow extends BaseWindow {
if (!newWs) {
return;
}
console.log("switchWorkspace newWs", newWs);
if (this.allTabViews.size) {
for (const tab of this.allTabViews.values()) {
tab?.destroy();
}
}
console.log("destroyed all tabs", this.waveWindowId);
this.workspaceId = workspaceId;
this.allTabViews = new Map();
const fullConfig = await FileService.GetFullConfig();
const [tabView, tabInitialized] = getOrCreateWebViewForTab(fullConfig, newWs.activetabid);
await this.queueTabSwitch(tabView, tabInitialized);
await this.setActiveTab(newWs.activetabid, false);
}

async setActiveTab(tabId: string, setInBackend: boolean) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/windowservice/windowservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (svc *WindowService) SwitchWorkspace(ctx context.Context, windowId string,

updates := waveobj.ContextGetUpdatesRtn(ctx)
go func() {
defer panichandler.PanicHandler("WorkspaceService:SwitchWorkspace:SendUpdateEvents")
defer panichandler.PanicHandler("WindowService:SwitchWorkspace:SendUpdateEvents")
wps.Broker.SendUpdateEvents(updates)
}()
return ws, err
Expand Down