Dont allow quitting the msc screen when msc is enabled

custom
jacqueline 1 year ago
parent 3dc0989c7f
commit cddfc2fbf7
  1. 6
      lua/settings.lua

@ -8,6 +8,7 @@ local controls = require("controls")
local bluetooth = require("bluetooth") local bluetooth = require("bluetooth")
local database = require("database") local database = require("database")
local screen = require("screen") local screen = require("screen")
local usb = require("usb")
local function SettingsScreen(title) local function SettingsScreen(title)
local menu = widgets.MenuScreen { local menu = widgets.MenuScreen {
@ -301,7 +302,6 @@ local MassStorageSettings = screen:new {
enable_container:Label { text = "Enable", flex_grow = 1 } enable_container:Label { text = "Enable", flex_grow = 1 }
local enable_sw = enable_container:Switch {} local enable_sw = enable_container:Switch {}
local usb = require("usb")
local bind_switch = function() local bind_switch = function()
if usb.msc_enabled:get() then if usb.msc_enabled:get() then
enable_sw:add_state(lvgl.STATE.CHECKED) enable_sw:add_state(lvgl.STATE.CHECKED)
@ -319,7 +319,9 @@ local MassStorageSettings = screen:new {
usb.msc_enabled:bind(bind_switch), usb.msc_enabled:bind(bind_switch),
} }
end, end,
canPop = true canPop = function()
return not usb.msc_enabled:get()
end
} }
local DatabaseSettings = screen:new { local DatabaseSettings = screen:new {

Loading…
Cancel
Save