try to fix the PWA chat issue

master
Aevann 2024-08-03 22:37:30 +03:00
parent f1507b26f3
commit 00af84629e
1 changed files with 13 additions and 0 deletions

View File

@ -363,19 +363,32 @@ function send_hearbeat() {
send_hearbeat()
setInterval(send_hearbeat, 20000);
const chatBox = document.getElementById('chat')
box.scrollTo(0, box.scrollHeight)
if (innerWidth <= 768)
chatBox.style.height = "calc(100dvh - 83.15px)"
setTimeout(function() {
box.scrollTo(0, box.scrollHeight)
if (innerWidth <= 768)
chatBox.style.height = "calc(100dvh - 83.15px)"
}, 200);
setTimeout(function() {
box.scrollTo(0, box.scrollHeight)
if (innerWidth <= 768)
chatBox.style.height = "calc(100dvh - 83.15px)"
}, 500);
setTimeout(function() {
box.scrollTo(0, box.scrollHeight)
if (innerWidth <= 768)
chatBox.style.height = "calc(100dvh - 83.15px)"
}, 1000);
setTimeout(function() {
box.scrollTo(0, box.scrollHeight)
if (innerWidth <= 768)
chatBox.style.height = "calc(100dvh - 83.15px)"
}, 1500);
document.addEventListener('DOMContentLoaded', function() {
box.scrollTo(0, box.scrollHeight)
if (innerWidth <= 768)
chatBox.style.height = "calc(100dvh - 83.15px)"
});