1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-13 05:19:50 +04:00

JS: gui: viewDispatcher.currentView

This commit is contained in:
Willy-JL
2024-10-17 18:03:29 +01:00
parent 78a0544b7a
commit d05c20bd9b
3 changed files with 14 additions and 3 deletions

View File

@@ -105,9 +105,13 @@ eventLoop.subscribe(views.bytekb.input, function (_sub, data, gui, views) {
}, gui, views);
// go to the demo chooser screen when the back key is pressed
eventLoop.subscribe(gui.viewDispatcher.navigation, function (_sub, _, gui, views) {
eventLoop.subscribe(gui.viewDispatcher.navigation, function (_sub, _, gui, views, eventLoop) {
if (gui.viewDispatcher.currentView === views.demos) {
eventLoop.stop();
return;
}
gui.viewDispatcher.switchTo(views.demos);
}, gui, views);
}, gui, views, eventLoop);
// run UI
gui.viewDispatcher.switchTo(views.demos);