mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
JS: Expose currentView in gui.viewDispatcher
This commit is contained in:
@@ -93,9 +93,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);
|
||||
|
||||
Reference in New Issue
Block a user