From 35d9d89563363bac84520b12a6df3c9d05455a4e Mon Sep 17 00:00:00 2001 From: MarekWo Date: Fri, 2 Jan 2026 06:45:10 +0100 Subject: [PATCH] fix: Sync DM read status after modal close and add Android PWA viewport fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two critical fixes: 1. DM Badge Sync Issue: - After closing DM modal, badge showed correct count for 10 seconds - Then auto-refresh (running every 10s) used stale dmLastSeenTimestamps - Solution: Call loadDmLastSeenTimestampsFromServer() before updating badge - This ensures app.js auto-refresh uses current server state 2. Android PWA Viewport Corruption: - Viewport corrupted on F5 refresh in Android PWA mode - Status bar content hidden under system UI - Solution: Force viewport recalculation on page load - Scrolls to top and forces reflow after 100ms delay Testing needed on Android PWA to verify both fixes work correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- app/templates/base.html | 14 ++++++++++++++ app/templates/index.html | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/app/templates/base.html b/app/templates/base.html index 5ed8e1d..1e1e413 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -262,6 +262,20 @@ + + + {% block extra_scripts %}{% endblock %} diff --git a/app/templates/index.html b/app/templates/index.html index fbd6ebd..4618a13 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -196,6 +196,12 @@ // Update DM badges when modal is closed (without full page reload) dmModal.addEventListener('hidden.bs.modal', async function () { try { + // Reload DM read status from server to sync with app.js automatic updates + // This ensures dmLastSeenTimestamps in app.js is current + if (typeof loadDmLastSeenTimestampsFromServer === 'function') { + await loadDmLastSeenTimestampsFromServer(); + } + // Fetch latest DM conversations with unread counts const response = await fetch('/api/dm/conversations'); if (response.ok) {