Skip to content

Initialize all streamers as offline on app startup #32

@BP602

Description

@BP602

Problem

When the app starts, streamers may show stale live status from previous sessions until the API calls complete. This can mislead users about who is actually live.

Expected Behavior

  • All streamers should start as offline/not live on app startup
  • Live status should only show as true after confirming with fresh API data

Current Behavior

  • App preserves previous session's live status until API responses update it
  • Can show incorrect "live" indicators temporarily

Recommended Implementation

Add this code in ChatProvider.jsx after line 803 (in the initializeOptimizedConnections function):

// Initialize all streamers as offline first to avoid showing stale live status
chatrooms.forEach(chatroom => {
  set(state => ({
    chatrooms: state.chatrooms.map(room =>
      room.id === chatroom.id 
        ? { ...room, isStreamerLive: false }
        : room
    )
  }));
});

Location

File: src/renderer/src/providers/ChatProvider.jsx
Function: initializeOptimizedConnections
After: Line 803 (after the console.log)

Acceptance Criteria

  • All streamers show as offline on app startup
  • Live status updates to correct state after API calls complete
  • No stale live indicators from previous sessions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions