#497 exit app if it is unloaded

This commit is contained in:
Mikayla Fischler 2024-06-14 17:38:45 -04:00
parent 1c719ad67b
commit ea8f62dea6

View File

@ -275,17 +275,23 @@ function pocket.init_nav(render_queue)
-- unload api-dependent apps
function nav.unload_api()
for _, app in pairs(self.apps) do
for id, app in pairs(self.apps) do
local _, api = app.check_requires()
if app.loaded and api then app.unload() end
if app.loaded and api then
if id == self.cur_app then nav.open_app(APP_ID.ROOT) end
app.unload()
end
end
end
-- unload supervisor-dependent apps
function nav.unload_sv()
for _, app in pairs(self.apps) do
for id, app in pairs(self.apps) do
local sv, _ = app.check_requires()
if app.loaded and sv then app.unload() end
if app.loaded and sv then
if id == self.cur_app then nav.open_app(APP_ID.ROOT) end
app.unload()
end
end
end