[FIX] mail: re-render thread once on newly added message
When we add a new message, it should re-render the thread only once. The `addMessage` function must handles new messages and updated messages. Some code for updated messages should not be executed for new messages, which is what this commit does.
This commit is contained in:
@@ -112,14 +112,15 @@ var MailManager = AbstractService.extend({
|
||||
if (!options.silent) {
|
||||
this._mailBus.trigger('new_message', message);
|
||||
}
|
||||
}
|
||||
if (data.moderation_status === 'accepted') {
|
||||
message.setModerationStatus('accepted', {
|
||||
additionalThreadIDs: data.channel_ids
|
||||
});
|
||||
}
|
||||
if (options.domain && options.domain !== []) {
|
||||
this._addMessageToThreads(message, options.domain);
|
||||
} else {
|
||||
if (data.moderation_status === 'accepted') {
|
||||
message.setModerationStatus('accepted', {
|
||||
additionalThreadIDs: data.channel_ids
|
||||
});
|
||||
}
|
||||
if (options.domain && options.domain !== []) {
|
||||
this._addMessageToThreads(message, options.domain);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user