From e6bcd71d89a8bd3167306511bd03d36b39f97258 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 22 Sep 2020 11:00:54 +0200 Subject: [PATCH] lint compliance --- www/common/outer/async-store.js | 46 +++++++++++++-------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 7c8793893..c3b72f6fa 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1458,37 +1458,27 @@ define([ var getVersionHash = function (clientId, data) { var validateKey; var fakeNetflux = Hash.createChannelId(); - nThen(function (waitFor) { - Store.getPadMetadata(null, { - channel: data.channel - }, function (md) { - // XXX not needed? we don't need to validate messages coming from history keeper - validateKey = md.validateKey; + Store.getHistoryRange(clientId, { + cpCount: 1, + channel: data.channel, + lastKnownHash: data.versionHash + }, function (obj) { + if (obj && obj.error) { + postMessage(clientId, "PAD_ERROR", obj.error); + return; + } + postMessage(clientId, "PAD_CONNECT", { + myID: fakeNetflux, + id: data.channel, + members: [fakeNetflux] }); - }).nThen(function () { - Store.getHistoryRange(clientId, { - cpCount: 1, - channel: data.channel, - lastKnownHash: data.versionHash - }, function (obj) { - if (obj && obj.error) { - postMessage(clientId, "PAD_ERROR", obj.error); - return; - } - postMessage(clientId, "PAD_CONNECT", { - myID: fakeNetflux, - id: data.channel, - members: [fakeNetflux] + (obj.messages || []).forEach(function (data) { + postMessage(clientId, "PAD_MESSAGE", { + msg: data.msg, + user: fakeNetflux.slice(0,16), // fake history keeper to avoid validate }); - (obj.messages || []).forEach(function (data) { - postMessage(clientId, "PAD_MESSAGE", { - msg: data.msg, - user: fakeNetflux.slice(0,16), // fake history keeper to avoid validate - validateKey: validateKey - }); - }); - postMessage(clientId, "PAD_READY"); }); + postMessage(clientId, "PAD_READY"); }); };