]> git.cworth.org Git - zombocom-ai/commitdiff
Fix some overloaded use of "name" variable
authorCarl Worth <cworth@cworth.org>
Thu, 8 Dec 2022 08:37:08 +0000 (00:37 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 8 Dec 2022 08:38:51 +0000 (00:38 -0800)
Which was causing some excess prompting for a user name.

index.html

index 75a4cb804a97938e6ec346604c2f34351dd54e34..0654ae41c33cc11f5e416ad2ff04b3ce70dcc901 100644 (file)
@@ -110,7 +110,7 @@ mute.addEventListener("click", () => {
   <script>
     var socket = io();
 
-    const name = document.querySelector("#name");
+    const name_input = document.querySelector("#name");
     const name_dialog = document.querySelector("#name-dialog");
     const images = document.querySelector("#images");
     const zombo_form = document.querySelector("#zombo-form");
@@ -126,7 +126,7 @@ mute.addEventListener("click", () => {
     });
 
     name_dialog.addEventListener('close', () => {
-        socket.emit('set-name', name.value);
+        socket.emit('set-name', name_input.value);
     });
 
     socket.on('comment', function(comment) {
@@ -141,7 +141,7 @@ mute.addEventListener("click", () => {
 
     socket.on('inform-name', (name) => {
         console.log("Received inform-name event: " + name);
-        name.value = name;
+        name_input.value = name;
     });
 
     socket.on('reset', () => {
@@ -176,7 +176,7 @@ mute.addEventListener("click", () => {
 
         comment_input.addEventListener('focus', () => {
             /* Do nothing if name is already set. */
-            if (name.value)
+            if (name_input.value)
                 return;
 
             /* Otherwise, bring up the modal dialog to set the name. */