summaryrefslogtreecommitdiff
path: root/scripts/socket
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-07-20 10:58:42 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-07-20 10:58:42 -0400
commit68db9abc7a02c78a0f170003c32d1fcd796eb212 (patch)
tree602e9be8f4641991a9666315426a8ca10807c78c /scripts/socket
parent5207f04d5b775bf4805d83c81aaad1cfcf3fe68a (diff)
Replace var with let + visual tweaks
- Replace var with let in most of my code - No longer bring cards to forfront of deck when hovering - Tweaks for dropdown selector input
Diffstat (limited to 'scripts/socket')
-rw-r--r--scripts/socket/message.js2
-rw-r--r--scripts/socket/sock.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/scripts/socket/message.js b/scripts/socket/message.js
index 0288cbc..ec8e912 100644
--- a/scripts/socket/message.js
+++ b/scripts/socket/message.js
@@ -9,7 +9,7 @@ class Message{
stringify ()
{
- var dat = this.d
+ let dat = this.d
if(typeof dat !== "string"){
dat = JSON.stringify(dat);
}
diff --git a/scripts/socket/sock.js b/scripts/socket/sock.js
index 0a04b63..2135551 100644
--- a/scripts/socket/sock.js
+++ b/scripts/socket/sock.js
@@ -36,7 +36,7 @@ class SockWorker extends EventTarget{
// Attempts to turn the message into a usable object and pass it to the callback
msg (e) {
if(typeof e.data == "string") {
- var dat = JSON.parse(e.data);
+ let dat = JSON.parse(e.data);
this.dispatchEvent(new CustomEvent(dat.type, {detail: dat.data}));
}
}
@@ -60,7 +60,7 @@ class SockWorker extends EventTarget{
// Send a message to the server
send (type, data) {
- var m = new Message(type, data);
+ let m = new Message(type, data);
this.socket.send(m.stringify())
}