fix: Improve viewport fix to avoid interfering with page initialization

Changed viewport fix approach to be less invasive:
- Removed document.body.style.height modification
- Use document.documentElement.offsetHeight instead
- Trigger resize event instead of modifying DOM
- Increased delay from 100ms to 150ms for better stability

This should prevent potential conflicts with channel loading and
other page initialization code.

🤖 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-02 06:56:10 +01:00
parent 35d9d89563
commit 797096b551

View File

@@ -266,13 +266,14 @@
<script>
// Fix viewport corruption on Android PWA after page reload
window.addEventListener('load', function() {
// Force viewport recalculation
// Force viewport recalculation without modifying body height
setTimeout(() => {
window.scrollTo(0, 0);
// Force reflow
document.body.style.height = '100%';
void(document.body.offsetHeight);
}, 100);
// Force reflow using a less invasive method
void(document.documentElement.offsetHeight);
// Trigger resize event to recalculate layout
window.dispatchEvent(new Event('resize'));
}, 150);
});
</script>