[Pkg-mozext-commits] [wot] 150/226: Fixed: RW was updated during the submit-process which caused clearing the comment field

David Prévot taffit at moszumanska.debian.org
Fri May 1 00:35:45 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository wot.

commit d2c16e47486905d59599203dcf675b23f15d4029
Author: Sergey Andryukhin <sorgoz at yandex.com>
Date:   Thu Sep 5 13:08:58 2013 +0300

    Fixed: RW was updated during the submit-process which caused clearing the comment field
---
 content/api.js             | 2 --
 content/ratingwindow.js    | 3 ++-
 content/rw/proxies.js      | 4 ++--
 content/rw/ratingwindow.js | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/content/api.js b/content/api.js
index 71fd60f..094b76d 100644
--- a/content/api.js
+++ b/content/api.js
@@ -1141,7 +1141,6 @@ var wot_keeper = {
     },
 
     save_comment: function (target, comment_body, wcid, votes, status) {
-//        console.log("keeper.save_comment()");
 
         var data = {
             timestamp: Date.now(),
@@ -1156,7 +1155,6 @@ var wot_keeper = {
     },
 
     remove_comment: function (target) {
-//        console.log("keeper.save_comment()");
         wot_keeper.remove_by_name(target, "comment");
     },
 
diff --git a/content/ratingwindow.js b/content/ratingwindow.js
index 5d00259..783e76d 100644
--- a/content/ratingwindow.js
+++ b/content/ratingwindow.js
@@ -304,7 +304,8 @@ var wot_rw = {
 
             wot_cache.set(target, "pending", true);
             wot_core.pending[target] = true;
-            wot_core.update();
+
+            if (data.update_rw) wot_core.update();  // updating rating window before the comment is also submitted is not a good idea
         }
     },
 
diff --git a/content/rw/proxies.js b/content/rw/proxies.js
index eba9fe2..0f2e9e7 100644
--- a/content/rw/proxies.js
+++ b/content/rw/proxies.js
@@ -127,8 +127,8 @@ $.extend(wot_bg.wot, wot, {
 
         api: {
 
-            submit: function (target, params) {
-                wot_bg.wot.core.moz_send("submit", { target: target, params: params });
+            submit: function (target, params, update_rw) {
+                wot_bg.wot.core.moz_send("submit", { target: target, params: params, update_rw: update_rw });
             },
 
             comments: {
diff --git a/content/rw/ratingwindow.js b/content/rw/ratingwindow.js
index e846e2a..f8905e6 100644
--- a/content/rw/ratingwindow.js
+++ b/content/rw/ratingwindow.js
@@ -253,7 +253,7 @@ $.extend(wot, { ratingwindow: {
                     params.changed_votes = changed_votes;
                 }
 
-                bgwot.api.submit(target, params);
+                bgwot.api.submit(target, params, false); // don't update RW yet
 
                 // count testimony event
                 // TODO: add either label or number to count voted categories AND/OR whether ratings were deleted

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/wot.git



More information about the Pkg-mozext-commits mailing list