Skip to content

Commit

Permalink
fix: fire realtime event when poll created
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkothari22 committed Apr 2, 2024
1 parent 3ef26e3 commit 18a38ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion raven/raven_messaging/doctype/raven_message/raven_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,16 @@ def on_update(self):
)
else:
after_commit = False
if self.message_type == "File" or self.message_type == "Image" or self.message_type == "Poll":
if self.message_type == "File" or self.message_type == "Image":
# If the message is a file or an image, then we need to wait for the file to be uploaded
after_commit = True
if not self.file:
return

if self.message_type == "Poll":
# If the message is a poll, then we need to wait for the poll to be created
after_commit = True

frappe.publish_realtime(
"message_created",
{
Expand Down

0 comments on commit 18a38ac

Please sign in to comment.