From b945a8d039410d8da429fa914b4a28fb233d4cf6 Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Fri, 1 Nov 2024 09:41:23 -0700 Subject: [PATCH] restore old tab naming logic (#1186) fixes the tab naming confusion going on in #1167 --- pkg/wcore/wcore.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/wcore/wcore.go b/pkg/wcore/wcore.go index 78761bc63..8b3f2d419 100644 --- a/pkg/wcore/wcore.go +++ b/pkg/wcore/wcore.go @@ -93,11 +93,15 @@ func CreateTab(ctx context.Context, windowId string, tabName string, activateTab return "", fmt.Errorf("error getting window: %w", err) } if tabName == "" { + ws, err := wstore.DBMustGet[*waveobj.Workspace](ctx, windowData.WorkspaceId) + if err != nil { + return "", fmt.Errorf("error getting workspace: %w", err) + } + tabName = "T" + fmt.Sprint(len(ws.TabIds)+1) client, err := wstore.DBGetSingleton[*waveobj.Client](ctx) if err != nil { return "", fmt.Errorf("error getting client: %w", err) } - tabName = "T" + fmt.Sprint(client.NextTabId) client.NextTabId++ err = wstore.DBUpdate(ctx, client) if err != nil {