summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/chat_window/chat_window.js
diff options
context:
space:
mode:
authorJulien Giannone <jgi@odoo.com>2021-01-15 10:32:52 +0000
committerJulien Giannone <jgi@odoo.com>2021-02-12 10:08:57 +0000
commita257e0ede12ead06c0f8dba90c3868761da6ea71 (patch)
tree9a85656d593e6c152b66c284d0e2d04ba908e42e /addons/mail/static/src/models/chat_window/chat_window.js
parent016dedf172f750a0fcb1138a798faf2a224d513e (diff)
[FIX] mail: (mobile) Prevent server sync for open/close state
This commit prevents the opening/closure of a channel on mobile when the action is performed on desktop and reciprocally closes odoo/odoo#64599 Tasks-id: 2267593 Related: odoo/enterprise#16296 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/chat_window/chat_window.js')
-rw-r--r--addons/mail/static/src/models/chat_window/chat_window.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/addons/mail/static/src/models/chat_window/chat_window.js b/addons/mail/static/src/models/chat_window/chat_window.js
index cf4b9442723..49e227428f5 100644
--- a/addons/mail/static/src/models/chat_window/chat_window.js
+++ b/addons/mail/static/src/models/chat_window/chat_window.js
@@ -39,9 +39,12 @@ function factory(dependencies) {
* Close this chat window.
*
* @param {Object} [param0={}]
- * @param {boolean} [param0.notifyServer=true]
+ * @param {boolean} [param0.notifyServer]
*/
- close({ notifyServer = true } = {}) {
+ close({ notifyServer } = {}) {
+ if (notifyServer === undefined) {
+ notifyServer = !this.env.messaging.device.isMobile;
+ }
const thread = this.thread;
this.delete();
// Flux specific: 'closed' fold state should only be saved on the
@@ -89,9 +92,12 @@ function factory(dependencies) {
/**
* @param {Object} [param0={}]
- * @param {boolean} [param0.notifyServer=true]
+ * @param {boolean} [param0.notifyServer]
*/
- fold({ notifyServer = true } = {}) {
+ fold({ notifyServer } = {}) {
+ if (notifyServer === undefined) {
+ notifyServer = !this.env.messaging.device.isMobile;
+ }
this.update({ isFolded: true });
// Flux specific: manually folding the chat window should save the
// new state on the server.
@@ -140,9 +146,12 @@ function factory(dependencies) {
/**
* @param {Object} [param0={}]
- * @param {boolean} [param0.notifyServer=true]
+ * @param {boolean} [param0.notifyServer]
*/
- unfold({ notifyServer = true } = {}) {
+ unfold({ notifyServer } = {}) {
+ if (notifyServer === undefined) {
+ notifyServer = !this.env.messaging.device.isMobile;
+ }
this.update({ isFolded: false });
// Flux specific: manually opening the chat window should save the
// new state on the server.