fix: Sync comment updates realtime

This commit is contained in:
Suraj Shetty 2021-01-11 17:19:56 +05:30
parent 18eb2a0fb4
commit 44358a38f4
2 changed files with 2 additions and 1 deletions

View file

@ -27,6 +27,7 @@ class Comment(Document):
def on_update(self):
update_comment_in_doc(self)
self.notify_change('update')
def on_trash(self):
self.remove_comment_from_cache()

View file

@ -1667,7 +1667,7 @@ frappe.ui.form.Form = class FrappeForm {
}
// no need to update timeline of owner of comment
// gets handled via comment submit code
if (!(doc.doctype === 'Comment' && doc.owner === frappe.session.user)) {
if (!(action === 'add' && doc.doctype === 'Comment' && doc.owner === frappe.session.user)) {
this.timeline && this.timeline.refresh();
}
});