closes odoo/odoo#105096 Related: odoo/enterprise#33679 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
26 lines
616 B
JavaScript
26 lines
616 B
JavaScript
/** @odoo-module **/
|
|
|
|
import { Patch } from '@mail/model';
|
|
|
|
Patch({
|
|
name: 'ChatWindow',
|
|
recordMethods: {
|
|
/**
|
|
* @override
|
|
*/
|
|
close({ notifyServer } = {}) {
|
|
if (
|
|
this.thread &&
|
|
this.thread.channel &&
|
|
this.thread.channel.channel_type === 'livechat' &&
|
|
this.thread.cache.isLoaded &&
|
|
this.thread.messages.length === 0
|
|
) {
|
|
notifyServer = true;
|
|
this.thread.unpin();
|
|
}
|
|
this._super({ notifyServer });
|
|
},
|
|
},
|
|
});
|