optimize previous commit
authorArt Cancro <ajc@citadel.org>
Tue, 27 Dec 2022 16:10:20 +0000 (11:10 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 27 Dec 2022 16:10:20 +0000 (11:10 -0500)
webcit-ng/static/js/view_mail.js

index 138be233ec67b490fafa0e420b7bc31888f46594..cd74cc73f1dbb7b7ed22f89f20b9e5c4d0b906c7 100644 (file)
@@ -269,12 +269,10 @@ function render_mailbox_display(notify) {
                        var i, row;
 
                        // If one or more messages was already selected, remember them so we can re-select them
-                       if (displayed_message > 0) {
-                               if (oldtable) {
-                                       for (i=0; row=oldtable.rows[i]; ++i) {
-                                               if (row.classList.contains("ctdl-mail-selected")) {
-                                                       previously_selected.push(parseInt(row["id"].substring(12)));
-                                               }
+                       if ( (displayed_message > 0) && (oldtable) ) {
+                               for (i=0; row=oldtable.rows[i]; ++i) {
+                                       if (row.classList.contains("ctdl-mail-selected")) {
+                                               previously_selected.push(parseInt(row["id"].substring(12)));
                                        }
                                }
                        }