Hide alerts page when no alerts are available

This commit is contained in:
emanuele-f 2019-06-11 11:14:38 +02:00
parent 204f7fd145
commit cc22879c85
2 changed files with 17 additions and 1 deletions

View file

@ -211,4 +211,20 @@ end
-- ##############################################
function system_scripts.hasAlerts(options)
local opts = table.merge(options, {ifid = getSystemInterfaceId()})
local old_iface = iface
local rv
interface.select(getSystemInterfaceId())
rv = (areAlertsEnabled() and
(getNumAlerts("historical", getTabParameters(opts, "historical")) > 0) or
(getNumAlerts("engaged", getTabParameters(opts, "engaged")) > 0))
interface.select(old_iface)
return(rv)
end
-- ##############################################
return system_scripts