From f4bf0325137001e633fc769ac3167441f900fd67 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 18 Apr 2019 15:15:07 +0200 Subject: [PATCH] Fix one case of duplicated content #352 --- www/common/outer/async-store.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 3dca7febf..ddc332bfd 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1058,14 +1058,16 @@ define([ onConnect: function (wc, sendMessage) { channel.sendMessage = function (msg, cId, cb) { // Send to server - sendMessage(msg, cb); - // Broadcast to other tabs - channel.pushHistory(CpNfWorker.removeCp(msg), /^cp\|/.test(msg)); - channel.bcast("PAD_MESSAGE", { - user: wc.myID, - msg: CpNfWorker.removeCp(msg), - validateKey: channel.data.validateKey - }, cId); + sendMessage(msg, function () { + // Broadcast to other tabs + channel.pushHistory(CpNfWorker.removeCp(msg), /^cp\|/.test(msg)); + channel.bcast("PAD_MESSAGE", { + user: wc.myID, + msg: CpNfWorker.removeCp(msg), + validateKey: channel.data.validateKey + }, cId); + cb(); + }); }; channel.wc = wc; channel.queue.forEach(function (data) {