mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-04 18:59:08 +01:00
restore old tab naming logic (#1186)
fixes the tab naming confusion going on in #1167
This commit is contained in:
parent
e7f906c5d1
commit
b945a8d039
@ -93,11 +93,15 @@ func CreateTab(ctx context.Context, windowId string, tabName string, activateTab
|
|||||||
return "", fmt.Errorf("error getting window: %w", err)
|
return "", fmt.Errorf("error getting window: %w", err)
|
||||||
}
|
}
|
||||||
if tabName == "" {
|
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)
|
client, err := wstore.DBGetSingleton[*waveobj.Client](ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("error getting client: %w", err)
|
return "", fmt.Errorf("error getting client: %w", err)
|
||||||
}
|
}
|
||||||
tabName = "T" + fmt.Sprint(client.NextTabId)
|
|
||||||
client.NextTabId++
|
client.NextTabId++
|
||||||
err = wstore.DBUpdate(ctx, client)
|
err = wstore.DBUpdate(ctx, client)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user