Fix initial history rules

pull/1/head
yflory 6 years ago
parent 6c6ce7b7a8
commit 42ffe0ee30

@ -153,6 +153,7 @@ define([
var markup = {}; var markup = {};
markup.message = function (msg) { markup.message = function (msg) {
if (msg.type !== 'MSG') { return; }
var curvePublic = msg.author; var curvePublic = msg.author;
var name = msg.name || contactsData[msg.author].displayName; var name = msg.name || contactsData[msg.author].displayName;
var d = msg.time ? new Date(msg.time) : undefined; var d = msg.time ? new Date(msg.time) : undefined;
@ -413,7 +414,7 @@ define([
$messages.find('div.cp-app-contacts-chat[data-key]').hide(); $messages.find('div.cp-app-contacts-chat[data-key]').hide();
if ($chat.length) { if ($chat.length) {
var $chat_messages = $chat.find('div.cp-app-contacts-message'); var $chat_messages = $chat.find('div.cp-app-contacts-message');
if (!$chat_messages.length || channel.needMoreHistory) { if ($chat_messages.length < 10) { //|| channel.needMoreHistory) { XXX
delete channel.needMoreHistory; delete channel.needMoreHistory;
var $more = $chat.find('.cp-app-contacts-more-history'); var $more = $chat.find('.cp-app-contacts-more-history');
$more.click(); $more.click();

Loading…
Cancel
Save