diff --git a/gate.lua b/gate.lua index 3de6b07..2a5ed3c 100644 --- a/gate.lua +++ b/gate.lua @@ -1,7 +1,7 @@ local DEFAULT_SERVER_BASE = "https://ticket.fse-media.group" local DEFAULT_SERVER_PATH = "/api/tickets/check" local GATE_OPEN_SECONDS = 2 -local VERSION = "v1.5.30" +local VERSION = "v1.5.31" local VERSION_CHECK_INTERVAL = 5 local PERIPHERAL_WAIT_INTERVAL = 0.5 local PERIPHERAL_WAIT_MAX_RETRIES = 40 @@ -440,6 +440,18 @@ end local _cachedDrawArgHash = nil +local function splitDisplayLines(s) + if s == nil then return {} end + local str = tostring(s) + if #trim(str) == 0 then return {} end + local lines = {} + for line in str:gmatch("[^\n]+") do + table.insert(lines, line) + end + if #lines == 0 then table.insert(lines, str) end + return lines +end + local function draw(statusLine1, statusLine2, statusColor) clear() if not termDev then return end