Only add _BASEROOM_ to the march list if the number of rooms added
authorArt Cancro <ajc@citadel.org>
Fri, 11 Feb 2022 23:00:47 +0000 (18:00 -0500)
committerArt Cancro <ajc@citadel.org>
Fri, 11 Feb 2022 23:00:47 +0000 (18:00 -0500)
to it was zero -- implying that there are no rooms with new messages.

webcit-ng/static/js/main.js

index b1275aaffdeb12b88777ab245be6e8777413370d..66131ebf0b5b3fafa2a1fcf33589cce12959df74 100644 (file)
@@ -142,7 +142,12 @@ function load_new_march_list(which_oper) {
                                }
                                return(a.name < b.name);
                        });
-                       march_list.push({name:"_BASEROOM_",known:true,hasnewmsgs:true,floor:0});
+
+                       // If there are still no rooms with new messages, go to the Lobby.
+                       if (march_list.length == 0) {
+                               march_list.push({name:"_BASEROOM_",known:true,hasnewmsgs:true,floor:0});
+                       }
+
                        console.log(march_list);
                        gotonext(which_oper);
                }