fix: Reload page after closing DM modal to update unread badges

Add event listener for DM modal close event that reloads the main page.
This ensures that unread DM badges are properly updated after user reads
messages in the DM modal.

Previously, when using the "Home" button, the page would reload via navigateTo('/').
Now with the "Close" button, the modal just closes without reloading, leaving
stale unread counts in the notification badges.

Changes:
- Add 'hidden.bs.modal' event listener to dmModal
- Call window.location.reload() when DM modal is closed
- This updates all unread badges on the main page

Note: This should not cause viewport corruption issues because:
1. Modal is fully closed before reload
2. No offcanvas or other Bootstrap components are active
3. Regular page reload, not navigation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-01-01 22:03:52 +01:00
parent a1f91816af
commit 46dfe7f7eb
+5
View File
@@ -192,6 +192,11 @@
dmFrame.src = dmFrame.src;
}
});
// Reload page when DM modal is closed to update unread badges
dmModal.addEventListener('hidden.bs.modal', function () {
window.location.reload();
});
}
if (contactsModal) {