Files
odoo_source/addons/im_livechat/static/src/models/chat_window.js
T
2022-11-06 02:16:48 +01:00

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 });
},
},
});