add quick spam check to postMsg
This commit is contained in:
parent
8eccefcd9d
commit
a4a0549738
@ -61,11 +61,19 @@ socket.addEventListener("open",()=> {
|
||||
|
||||
var cd = true //inversed "cooldown"
|
||||
|
||||
let last_called_postMsg = Date.now()
|
||||
|
||||
/*
|
||||
Tell the api to create a new post with the given information
|
||||
previously called "postMessage"
|
||||
*/
|
||||
function postMsg() {
|
||||
if(last_called_postMsg - Date.now() < 100) {
|
||||
createModal("slow down there")
|
||||
debugger;
|
||||
return;
|
||||
}
|
||||
last_called_postMsg = Date.now()
|
||||
let msg = getById("post-text").value
|
||||
let len = msg.length
|
||||
if(len==0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user