your-land/yl_announcements#1 Announcement removes itself after expiry

This commit is contained in:
AliasAlreadyTaken 2024-05-27 23:52:29 +02:00
parent b77b2b0849
commit 54436d562f

View File

@ -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)