generated from your-land/yl_template
your-land/yl_announcements#1 Announcement removes itself after expiry
This commit is contained in:
parent
b77b2b0849
commit
54436d562f
@ -51,7 +51,11 @@ local gs = function(dtime)
|
||||
|
||||
-- Check if any announcement should be displayed
|
||||
for _, announcement in pairs(data) do
|
||||
if current_time >= (announcement.next_runtime or 0) then -- announcement.next_runtime exists
|
||||
-- Check if any announcement needs to be removed from the list due to runtime expired.
|
||||
if ((type(announcement.runtime) == "number") and
|
||||
(current_time >= (announcement.creation_date + announcement.runtime))) then
|
||||
yl_announcements.delete(announcement.id)
|
||||
elseif current_time >= (announcement.next_runtime or 0) then
|
||||
|
||||
if (type(announcement.next_runtime) ~= "number") then
|
||||
table.insert(affected_bucket, announcement.frequency)
|
||||
|
Loading…
Reference in New Issue
Block a user