diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-05-03 16:40:39 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-05-03 16:40:39 +1000 |
| commit | 344a46d0664eb75d232eacea91a4957a25e071f6 (patch) | |
| tree | e6ee54d9c8060af3d3bb94ec4b79e9d505b270e5 /lua/main.lua | |
| parent | 3ceb8025ee4330c177101ed30ec17dfb0002f41e (diff) | |
| download | tangara-fw-344a46d0664eb75d232eacea91a4957a25e071f6.tar.gz | |
Respond to sd card mounts and unmounts within lua
Includes no longer blocking the main menu on an sd card being inserted!!
Diffstat (limited to 'lua/main.lua')
| -rw-r--r-- | lua/main.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lua/main.lua b/lua/main.lua index dc73c964..e5adcaae 100644 --- a/lua/main.lua +++ b/lua/main.lua @@ -3,12 +3,15 @@ local vol = require("volume") local theme = require("theme") local controls = require("controls") local time = require("time") - -local lock_time = time.ticks() +local sd_card = require("sd_card") +local backstack = require("backstack") +local main_menu = require("main_menu") local theme_dark = require("theme_dark") theme.set(theme_dark) +local lock_time = time.ticks() + -- Set up property bindings that are used across every screen. GLOBAL_BINDINGS = { -- Show an alert with the current volume whenever the volume changes @@ -52,9 +55,8 @@ GLOBAL_BINDINGS = { end end end), + sd_card.mounted:bind(function(mounted) + print("reset ui stack") + backstack.reset(main_menu:new()) + end), } - -local backstack = require("backstack") -local main_menu = require("main_menu") - -backstack.push(main_menu) |
