fix error when comment doesnt exist on the page ur currently in

pull/211/head
Aevann 2023-09-28 01:10:06 +03:00
parent ad16527a40
commit 749ebe4e23
1 changed files with 6 additions and 4 deletions

View File

@ -2,10 +2,12 @@ const socket = io()
socket.on('insert_reply', function(data) {
const replies = document.getElementById(`replies-of-c_${data[0]}`)
replies.insertAdjacentHTML('beforeend', data[1]);
if (replies) {
replies.insertAdjacentHTML('beforeend', data[1]);
notifs = notifs + 1;
if (notifs == 1) {
flash();
notifs = notifs + 1;
if (notifs == 1) {
flash();
}
}
})