svghmi/widget_back.ysl2
changeset 3653 d5ff60e906b0
parent 3241 fe945f1f48b7
child 3654 6b7f15089703
--- a/svghmi/widget_back.ysl2	Fri Oct 28 10:42:35 2022 +0200
+++ b/svghmi/widget_back.ysl2	Fri Nov 04 10:51:45 2022 +0100
@@ -14,8 +14,12 @@
     ||
         on_click(evt) {
             if(jump_history.length > 1){
-               jump_history.pop();
-               let [page_name, index] = jump_history.pop();
+               let page_name, index;
+               do {
+                   jump_history.pop(); // forget current page
+                   if(jump_history.length == 0) return;
+                   [page_name, index] = jump_history[jump_history.length-1];
+               } while(page_name == "ScreenSaver") // never go back to ScreenSaver
                switch_page(page_name, index);
             }
         }