This commit is contained in:
parent
b2391b058b
commit
0d39d6e981
@ -12,6 +12,7 @@ const runChat = async () => {
|
|||||||
const scrollTopMax = scrollHeight - clientTop;
|
const scrollTopMax = scrollHeight - clientTop;
|
||||||
const isAtEdge = scrollTop > (0.92 * scrollTopMax) || scrollTop === 0;
|
const isAtEdge = scrollTop > (0.92 * scrollTopMax) || scrollTop === 0;
|
||||||
document.getElementById("messages").innerHTML = html;
|
document.getElementById("messages").innerHTML = html;
|
||||||
|
await new Promise((res) => setTimeout(res, 200)); // wait for html to emplace.
|
||||||
if (!document.getElementById("chat-container")) return;
|
if (!document.getElementById("chat-container")) return;
|
||||||
const emplacedScrollTopMax = document.getElementById("chat-container").scrollHeight - document.getElementById("chat-container").clientTop;
|
const emplacedScrollTopMax = document.getElementById("chat-container").scrollHeight - document.getElementById("chat-container").clientTop;
|
||||||
if (isAtEdge) {
|
if (isAtEdge) {
|
||||||
|
Loading…
Reference in New Issue
Block a user