Skip to content

Commit

Permalink
Allow monarch.post() to loaded screens
Browse files Browse the repository at this point in the history
Fixes #98
  • Loading branch information
britzl committed Oct 26, 2023
1 parent 84944f3 commit 742779d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monarch/monarch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 742779d

Please sign in to comment.