Fix an issue with last known hash in the messenger

This commit is contained in:
yflory
2018-11-27 13:41:03 +01:00
parent dbad925e5e
commit 2a46b8f855
2 changed files with 61 additions and 39 deletions

View File

@@ -202,6 +202,9 @@ define([
}, []);
};
var clearChannel = function (id) {
$(getChat(id)).find('.cp-app-contacts-messages').html('');
};
markup.chatbox = function (id, data, curvePublic) {
var moreHistory = h('span.cp-app-contacts-more-history.fa.fa-history', {
title: Messages.contacts_fetchHistory,
@@ -277,14 +280,14 @@ define([
UI.alert(Messages.contacts_removeHistoryServerError);
return;
}
// TODO clear the UI
clearChannel(id);
});
});
});
var avatar = h('div.cp-avatar');
var headerContent = [avatar, moreHistory, data.isFriendCHat ? removeHistory : undefined];
var headerContent = [avatar, moreHistory, data.isFriendChat ? removeHistory : undefined];
if (isApp) {
headerContent = [
h('div.cp-app-contacts-header-title', Messages.contacts_padTitle),
@@ -814,6 +817,10 @@ define([
onMessengerReady();
return;
}
if (obj.ev === 'CLEAR_CHANNEL') {
clearChannel(obj.data);
return;
}
if (obj.ev === 'PADCHAT_READY') {
onPadChatReady(obj.data);
return;