[FIX] mail: re-render discuss on message_fetch with typing members
When (un)registering a typing members of a channel, the discuss sidebar must be re-render. This is necessary in order to display the typing indicator next to discuss items, i.e. '...'. When receiving a message from a typing member, this person no longer becomes a typing member. Before this commit, for each new messages, the discuss sidebar was re-rendered. This happens due to unregistering the author from the typing members of the channel, even when the author was not a typing member in the first place. With this commit, when the list of typing members of a channel does not change, the discuss sidebar won't re-render and slow down the whole UI. opw-2035443 closes odoo/odoo#33616 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
This commit is contained in:
@@ -171,11 +171,15 @@ var ThreadTypingMixin = {
|
||||
if (this._isTypingMyselfInfo(params)) {
|
||||
return;
|
||||
}
|
||||
var partnerID = params.partnerID;
|
||||
this._othersTypingTimers.registerTimer({
|
||||
timeoutCallbackArguments: [params.partnerID],
|
||||
timerID: params.partnerID,
|
||||
timeoutCallbackArguments: [partnerID],
|
||||
timerID: partnerID,
|
||||
});
|
||||
this._typingPartnerIDs.push(params.partnerID);
|
||||
if (_.contains(this._typingPartnerIDs, partnerID)) {
|
||||
return;
|
||||
}
|
||||
this._typingPartnerIDs.push(partnerID);
|
||||
this._warnUpdatedTypingPartners();
|
||||
},
|
||||
/**
|
||||
@@ -209,6 +213,9 @@ var ThreadTypingMixin = {
|
||||
unregisterTyping: function (params) {
|
||||
var partnerID = params.partnerID;
|
||||
this._othersTypingTimers.unregisterTimer({ timerID: partnerID });
|
||||
if (!_.contains(this._typingPartnerIDs, partnerID)) {
|
||||
return;
|
||||
}
|
||||
this._typingPartnerIDs = _.reject(this._typingPartnerIDs, function (id) {
|
||||
return id === partnerID;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user