From c73165e496af9c2c8076607bd7a8dc59e810b551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Vitor?= Date: Thu, 12 Sep 2024 10:40:54 -0300 Subject: [PATCH] fix: fixes auto scroll --- public/scripts/home.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/scripts/home.js b/public/scripts/home.js index 36b8e3e..da5d1b9 100644 --- a/public/scripts/home.js +++ b/public/scripts/home.js @@ -9,6 +9,8 @@ const reset = document.getElementById('reset') const notes = document.querySelector('input') +let height = 0 + const getStorage = () => JSON.parse(localStorage.getItem('bot_sambanet')) || [] const setStorage = (data) => { @@ -21,6 +23,7 @@ const clearAll = () => { setStorage([]) logs = [] ul.innerHTML = '
  • Painel de logs
  • ' + height = 0 } const disableButtons = () => { @@ -41,7 +44,8 @@ const render = (msg) => { ? text : `${text}` ul.appendChild(li) - ul.scrollTop = ul.clientHeight + height += li.clientHeight + ul.scrollTop = height } start.onclick = () => {