| 1 | import type { TabMeta } from "./types"; |
| 2 | |
| 3 | export function editMockGoalTab(tab: TabMeta, tabId: string, objective: string, maxGoalRounds: number | null): TabMeta { |
| 4 | if (tab.id !== tabId) return tab; |
| 5 | const current = tab.goalView; |
| 6 | return { |
| 7 | ...tab, |
| 8 | goal: objective.trim(), |
| 9 | goalView: current ? { ...current, objective: objective.trim(), maxGoalRounds, revision: current.revision + 1 } : current, |
| 10 | }; |
| 11 | } |
| 12 |