mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-12-03 10:33:49 +01:00
Adds a sticky 'support_chat_active' bool to Settings, flipped to true the first time SupportChatService.openChat succeeds. HelpButton becomes a StatefulWidget; if the flag is set in initState it kicks off a background fetchChat() and counts admin-side messages whose createdAt is later than the chat's lastSeenAt. When at least one is found, a small destructive-coloured dot appears both on the button's leading icon (top-right corner) and as the trailing slot of the inline 'Chat with Support' menu entry. Opening the chat clears the dot locally and re-runs the unread check on return so the indicator stays in sync with what the user has now seen. All checks are best-effort: missing auth, network errors, and edge-function failures are swallowed and the dot just stays off. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>