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:
parent
b3679d6642
commit
c8a7b83fc4
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue