From 5840703d0628469cda69ec26939f9d49c6ce3240 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 18 Feb 2021 15:41:13 +0100 Subject: [PATCH 1/2] Fix CSS race condition in the messenger --- customize.dist/src/less2/include/messenger.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/customize.dist/src/less2/include/messenger.less b/customize.dist/src/less2/include/messenger.less index e3599f74e..670c6994b 100644 --- a/customize.dist/src/less2/include/messenger.less +++ b/customize.dist/src/less2/include/messenger.less @@ -55,12 +55,12 @@ } } - .cp-app-contacts-spinner { + span.cp-app-contacts-spinner { display: none; } .cp-app-contacts-initializing { - .cp-app-contacts-spinner { + span.cp-app-contacts-spinner { color: @cp_messenger-fg; display: block; } From f5908e5f5783f0fda8473f2ecbe021cd7b2ad3c6 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 18 Feb 2021 16:28:40 +0100 Subject: [PATCH 2/2] Fix history range --- lib/workers/db-worker.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/workers/db-worker.js b/lib/workers/db-worker.js index a8aa8f154..5750ff7ac 100644 --- a/lib/workers/db-worker.js +++ b/lib/workers/db-worker.js @@ -348,10 +348,7 @@ const getOlderHistory = function (data, cb) { if (hash === oldestKnownHash) { found = true; } - messages.push({ - msg: parsed, - hash: hash, - }); + messages.push(parsed); }, function (err) { var toSend = []; if (typeof (desiredMessages) === "number") { @@ -359,14 +356,14 @@ const getOlderHistory = function (data, cb) { } else if (untilHash) { for (var j = messages.length - 1; j >= 0; j--) { toSend.unshift(messages[j]); - if (messages[j] && messages[j].hash === untilHash) { + if (Array.isArray(messages[j]) && HK.getHash(messages[j][4]) === untilHash) { break; } } } else { let cpCount = 0; for (var i = messages.length - 1; i >= 0; i--) { - if (/^cp\|/.test(messages[i].msg[4]) && i !== (messages.length - 1)) { + if (/^cp\|/.test(messages[i][4]) && i !== (messages.length - 1)) { cpCount++; } toSend.unshift(messages[i]);