Fix dropdown optimistic updates to use correct stream group names

- Include team name prefix in optimistic update stream group generation
- Format: {team_name}_{stream_name}_stream to match backend file writes
- Prevents dropdown from reverting to wrong value after selection
- Now dropdown shows correct selection immediately without requiring page refresh

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Decobus 2025-07-22 15:48:10 -04:00
parent b3679d6642
commit c8a7b83fc4

View file

@ -93,9 +93,9 @@ export default function Home() {
const handleSetActive = useCallback(async (screen: ScreenType, id: number | null) => {
const selectedStream = streams.find((stream) => stream.id === id);
// Generate stream group name for optimistic updates
// Generate stream group name for optimistic updates - must match obsClient.js format
const streamGroupName = selectedStream
? `${selectedStream.name.toLowerCase().replace(/\s+/g, '_')}_stream`
? `${selectedStream.team_name?.toLowerCase().replace(/\s+/g, '_') || 'unknown'}_${selectedStream.name.toLowerCase().replace(/\s+/g, '_')}_stream`
: null;
// Update local state immediately for optimistic updates