InfiniTime.git

commit fb19c491b6f82dd3dfb2f031a1398ce4feb263a5

Author: Riku Isokoski <riksu9000@gmail.com>

Fix returning to the same screen

 src/displayapp/DisplayApp.cpp | 9 +++++++--


diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 74af01b3fabc7f1e82150aab8f40cbd44a3976ff..69830eadbdd7b8040e5c773083bb44cf0c388c61 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -329,8 +329,13 @@   nextDirection = direction;
 }
 
 void DisplayApp::LoadNewScreen(Apps app, DisplayApp::FullRefreshDirections direction) {
-  returnAppStack.Push(currentApp);
-  appStackDirections.Push(direction);
+  // Don't add the same screen to the stack back to back.
+  // This is mainly to fix an issue with receiving two notifications at the same time
+  // and shouldn't happen otherwise.
+  if (app != currentApp) {
+    returnAppStack.Push(currentApp);
+    appStackDirections.Push(direction);
+  }
   LoadScreen(app, direction);
 }