From 374b015f8fdcf5c4cf322ed490d23e6c2c3f56eb Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Aug 2015 12:18:04 +0530 Subject: [PATCH] [fix] duplicate comment in realtime --- frappe/public/js/frappe/model/model.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/model/model.js b/frappe/public/js/frappe/model/model.js index 3742bab18e..6aa54c4dd4 100644 --- a/frappe/public/js/frappe/model/model.js +++ b/frappe/public/js/frappe/model/model.js @@ -157,8 +157,14 @@ $.extend(frappe.model, { if (frappe.model.docinfo[comment.comment_doctype] && frappe.model.docinfo[comment.comment_doctype][comment.comment_docname]) { var comments = frappe.model.docinfo[comment.comment_doctype][comment.comment_docname].comments; - var comment_exists = !!$.map(comments, - function(x) { return x.name == comment.name? true : undefined}).length + + var comment_exists = false; + for (var i=0, l=comments.length; i