mirror of
https://github.com/sartoopjj/thefeed.git
synced 2026-05-18 06:44:34 +03:00
2ff7cbd751
window.innerWidth can briefly report the desktop viewport width when
the page is restored from a long Android background session, causing
openChat() to skip adding chat-open even though chatIsOpen is true.
Replace all window.innerWidth checks with mobileQuery.matches so the
JS breakpoint always agrees with CSS. Also swap the resize listener
for mobileQuery.addEventListener('change') which only fires when the
breakpoint actually crosses, and add a visibilitychange handler to
re-apply chat-open when the app returns to the foreground.