[FIX] mail: mark a message as read should not hide 'load more' button
It was hidding it because the method that removes a message from the thread didn't pass the options for the thread rendering, and the flag specifiying whether or not the 'load more' button should be displayed is in this options object.
This commit is contained in:
committed by
Géry Debongnie
parent
6b3f1c1b22
commit
730efcc3df
@@ -409,7 +409,8 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
|
||||
if ((this.channel_id === "channel_starred" && !message.is_starred) ||
|
||||
(this.channel_id === "channel_inbox" && !message.is_needaction)) {
|
||||
chat_manager.fetch(this.channel_id, this.domain).then(function (messages) {
|
||||
self.thread.remove_message_and_render(message.id, messages);
|
||||
var options = {display_load_more: !chat_manager.all_history_loaded(self.channel_id)};
|
||||
self.thread.remove_message_and_render(message.id, messages, options);
|
||||
});
|
||||
} else if (_.contains(message.channel_ids, this.channel_id)) {
|
||||
this.fetch_and_render_thread();
|
||||
|
||||
@@ -91,11 +91,12 @@ var Thread = Widget.extend({
|
||||
* Removes a message and re-renders the thread
|
||||
* @param {int} [message_id] the id of the removed message
|
||||
* @param {array} [messages] the list of messages to display, without the removed one
|
||||
* @param {object} [options] options for the thread rendering
|
||||
*/
|
||||
remove_message_and_render: function (message_id, messages) {
|
||||
remove_message_and_render: function (message_id, messages, options) {
|
||||
var self = this;
|
||||
this.$('.o_thread_message[data-message-id=' + message_id + ']').fadeOut({
|
||||
done: function () { self.render(messages); }
|
||||
done: function () { self.render(messages, options); }
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user