3
0
mirror of https://github.com/britzl/monarch.git synced 2025-06-27 02:17:53 +02:00

Allow monarch.post() to loaded screens

Fixes #98
This commit is contained in:
Björn Ritzl 2023-10-26 13:54:14 +02:00
parent 84944f3f22
commit 742779d749

View File

@ -1189,8 +1189,8 @@ end
-- @return error (string|nil) Error message if unable to send message
function M.post(id, message_id, message)
assert(id, "You must provide a screen id")
if not M.is_visible(id) then
return false, "Unable to post message to screen if it isn't visible"
if not M.is_loaded(id) then
return false, "Unable to post message to screen if it isn't loaded"
end
assert(message_id, "You must provide a message_id")