From 32ba1a24a09fc40127137d78a847454800eb8ad7 Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Sat, 18 Jun 2022 12:25:24 +0200 Subject: [PATCH] fix bug where not replying would crash the server --- js/posts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/posts.js b/js/posts.js index d649aaf..cf8cbbb 100644 --- a/js/posts.js +++ b/js/posts.js @@ -5,7 +5,7 @@ const wss_server = "wss://ipost.tk" const wss_port = "443" const wss_URI = wss_server + ":" + wss_port -var reply_id = -1 +var reply_id = 0 let socket = new WebSocket(wss_URI); socket.addEventListener("message", function (event) { @@ -173,7 +173,7 @@ function reply(username,postid,posttext) { function unreply() { document.getElementById("reply").style = "display:none;" - reply_id = -1 + reply_id = 0 } main()