(ctx context.Context, workspaceId string, tabId string)
| 351 | } |
| 352 | |
| 353 | func SetActiveTab(ctx context.Context, workspaceId string, tabId string) error { |
| 354 | if tabId != "" && workspaceId != "" { |
| 355 | workspace, err := GetWorkspace(ctx, workspaceId) |
| 356 | if err != nil { |
| 357 | return fmt.Errorf("workspace %s not found: %w", workspaceId, err) |
| 358 | } |
| 359 | tab, _ := wstore.DBGet[*waveobj.Tab](ctx, tabId) |
| 360 | if tab == nil { |
| 361 | return fmt.Errorf("tab not found: %q", tabId) |
| 362 | } |
| 363 | workspace.ActiveTabId = tabId |
| 364 | wstore.DBUpdate(ctx, workspace) |
| 365 | } |
| 366 | return nil |
| 367 | } |
| 368 | |
| 369 | func SendActiveTabUpdate(ctx context.Context, workspaceId string, newActiveTabId string) { |
| 370 | eventbus.SendEventToElectron(eventbus.WSEventType{ |
no test coverage detected