mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#497 exit app if it is unloaded
This commit is contained in:
parent
1c719ad67b
commit
ea8f62dea6
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user