From fa277c126ff32087d16295f3360c2ab6f50cf6d9 Mon Sep 17 00:00:00 2001 From: Xander Date: Thu, 7 Dec 2023 22:20:07 +0100 Subject: [PATCH] Working sockets --- content/assets/scripts/message.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/assets/scripts/message.js b/content/assets/scripts/message.js index 007bc133..39c543bf 100644 --- a/content/assets/scripts/message.js +++ b/content/assets/scripts/message.js @@ -14,7 +14,7 @@ socket.on('replymessage', function(obj) { $("#cammieForm").submit((e) => { e.preventDefault(); formButton.addClass("is-loading"); - socket.timeout(4000).emit("message",{username: formName.val(), message: formMessage.val()},(err,_) => { + socket.timeout(3000).emit("message",{username: formName.val(), message: formMessage.val()},(err,_) => { if (err) { responseSuccess.addClass("is-hidden"); responseError.removeClass("is-hidden"); @@ -25,5 +25,6 @@ $("#cammieForm").submit((e) => { responseSuccess.text("Message has been successfully sent."); formMessage.val(""); } + formButton.removeClass("is-loading"); }) });