mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
Replace full page reload with targeted badge update when DM modal closes. This prevents the viewport corruption issue that was reintroduced by window.location.reload() in the previous commit. Problem: - Previous solution used window.location.reload() to update badges - This caused viewport corruption (status bar hidden under system UI) - Same issue we solved by using modals instead of navigation New solution: - Fetch latest unread counts from /api/dm/updates when modal closes - Update only the green DM badge (notification-badge-dm) on notification bell - No page reload = no viewport corruption - Keeps modal solution benefits intact Changes: - Remove window.location.reload() from hidden.bs.modal event listener - Add async fetch to /api/dm/updates endpoint - Update notification-badge-dm element directly using DOM manipulation - Handle badge creation/update/hiding based on unread count Result: - DM badges update correctly after closing modal - No viewport corruption - Fast, smooth user experience 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>