make chat work on back button

master
Aevann 2024-11-13 19:48:37 +02:00
parent 113005d2a4
commit 8844bfedfc
1 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,10 @@
let socket = io()
addEventListener("pageshow", () => {
socket.disconnect();
socket.connect();
});
function formatHourMinute(d) {
return d.toLocaleTimeString([], {timeStyle: 'short'})
}
@ -7,8 +14,6 @@ for (const e of document.querySelectorAll('[data-time]')) {
const ua = window.navigator.userAgent
const socket = io()
const chat = document.getElementById('chat')
const chat_id = document.getElementById('chat_id').value
const chatline = document.getElementsByClassName('chat-line')[0]