From 499b750508df1d02440dda8d28ab5343e7501261 Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Sat, 7 Mar 2026 21:52:39 +0300 Subject: [PATCH] client: Fix chat window disappear on mobile The chat window appears when #show-chat is clicked. That click leads to #left becoming visible, which contains chat elements. However when mobile user taps #input, on-screen keyboard appears, which triggers screen resize -> setViewportHeight() and the latter calls showVideo() which hides the chat completely. -> Fix that by doing showVideo() in setViewportHeight() only if we were not in chat mode. --- static/galene.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/static/galene.js b/static/galene.js index 3c7f75c..8bc5e2a 100644 --- a/static/galene.js +++ b/static/galene.js @@ -533,7 +533,9 @@ function setViewportHeight() { document.documentElement.style.setProperty( '--vh', `${window.innerHeight/100}px`, ); - showVideo(); + if (!getVisibility('left')) { + showVideo(); + } // Ajust video component size resizePeers(); } @@ -577,6 +579,16 @@ function setVisibility(id, visible) { elt.classList.add('invisible'); } +/** + * getVisibility tells whether specified element is visible. + * + * @param {string} id + */ +function getVisibility(id) { + let elt = document.getElementById(id); + return !elt.classList.contains('invisible'); +} + /** * Shows and hides various UI elements depending on the protocol state. */