restore old tab naming logic (#1186)

fixes the tab naming confusion going on in #1167
This commit is contained in:
Mike Sawka 2024-11-01 09:41:23 -07:00 committed by GitHub
parent e7f906c5d1
commit b945a8d039
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {