]> git.mdlowis.com Git - proto/atv.git/commitdiff
attempted to rework UI to fix path bug in the control page master
authorMike Lowis <mike.lowis@gentex.com>
Thu, 6 Feb 2025 19:59:30 +0000 (14:59 -0500)
committerMike Lowis <mike.lowis@gentex.com>
Thu, 6 Feb 2025 19:59:30 +0000 (14:59 -0500)
atv/assets/client.js
atv/assets/control.html
atv/assets/ui.js

index 6522cd61ed5027fc557a9a7fd5d7fe92c549954c..265c4ca5c32d845b1fd455f3bc5b64d2e5a57ed2 100644 (file)
@@ -9,6 +9,7 @@ const Client = ((self = {})=>{
             "ws://" + window.location.host + ":3000");
 
         ws.onopen = (event)=>{
+            onmsg({cmd: "connect"})
             self.send("get_items", {});
             self.send("get_queue", {});
         }
index 73e6cf959a5c2d06961850b5e8705fdc54d47446..7fb733f2686d4b9016e8d36ca513b6529df5b6c7 100644 (file)
 (()=>{
     Client.connect((data)=>{
         console.log(data);
-        if (cmd.cmd === "items")
+        if (cmd.cmd === "connect")
+        {
+            UI.reset();
+        }
+        else if (cmd.cmd === "items")
         {
             UI.set_items( data.items );
         }
index 01b50496cbc2338f527670c1132d59a0d85e0519..15e78a9eb7c38323b894a932fe5968eb6d9d3b16 100644 (file)
@@ -23,6 +23,10 @@ const UI = (()=>{
     self.select_file = ()=>{ showBrowser(); };
     self.cancel      = ()=>{ showMain(); };
 
+    self.reset = ()=>{
+        path = [];
+    };
+
     self.enqueue = (path)=>{
         console.log(path);
         Client.send("enqueue", { path: path });