Add sys info consts

This commit is contained in:
Artsiom Trubchyk 2021-02-11 12:33:32 +03:00
parent cfd654c1b2
commit fa559a2a28
2 changed files with 6 additions and 2 deletions

View File

@ -51,6 +51,10 @@ M.PIVOTS = {
} }
M.SYS_INFO = sys.get_sys_info()
M.CURRENT_SYSTEM_NAME = M.SYS_INFO.system_name
M.OS = { M.OS = {
ANDROID = "Android", ANDROID = "Android",
IOS = "iPhone OS", IOS = "iPhone OS",

View File

@ -183,14 +183,14 @@ end
--- Check if device is mobile (Android or iOS) --- Check if device is mobile (Android or iOS)
-- @function helper..is_mobile -- @function helper..is_mobile
function M.is_mobile() function M.is_mobile()
return system_name == const.OS.IOS or SYSTEM_NAME == const.OS.ANDROID return const.CURRENT_SYSTEM_NAME == const.OS.IOS or const.CURRENT_SYSTEM_NAME == const.OS.ANDROID
end end
--- Check if device is HTML5 --- Check if device is HTML5
-- @function helper.is_web -- @function helper.is_web
function M.is_web() function M.is_web()
return system_name == const.OS.BROWSER return const.CURRENT_SYSTEM_NAME == const.OS.BROWSER
end end