From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- .../components/thread_preview/thread_preview.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 addons/im_livechat/static/src/components/thread_preview/thread_preview.js (limited to 'addons/im_livechat/static/src/components/thread_preview') diff --git a/addons/im_livechat/static/src/components/thread_preview/thread_preview.js b/addons/im_livechat/static/src/components/thread_preview/thread_preview.js new file mode 100644 index 00000000..ea752b56 --- /dev/null +++ b/addons/im_livechat/static/src/components/thread_preview/thread_preview.js @@ -0,0 +1,28 @@ +odoo.define('im_livechat/static/src/components/thread_preview/thread_preview.js', function (require) { +'use strict'; + +const components = { + ThreadPreview: require('mail/static/src/components/thread_preview/thread_preview.js'), +}; + +const { patch } = require('web.utils'); + +patch(components.ThreadPreview, 'im_livechat/static/src/components/thread_preview/thread_preview.js', { + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * @override + */ + image(...args) { + if (this.thread.channel_type === 'livechat') { + return '/mail/static/src/img/smiley/avatar.jpg'; + } + return this._super(...args); + } + +}); + +}); -- cgit v1.2.3