From 5cc021663daa9e564a19f46f90378e426b8115d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexandre=20K=C3=BChn?= <aku@odoo.com>
Date: Mon, 21 Mar 2022 14:08:58 +0000
Subject: [PATCH] [IMP] mail: guard ChatWindowComponent
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Task-2797754

closes odoo/odoo#86779

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
---
 .../components/chat_window/chat_window.xml    | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/addons/mail/static/src/components/chat_window/chat_window.xml b/addons/mail/static/src/components/chat_window/chat_window.xml
index 7631313cc079..e248dd74189a 100644
--- a/addons/mail/static/src/components/chat_window/chat_window.xml
+++ b/addons/mail/static/src/components/chat_window/chat_window.xml
@@ -2,16 +2,16 @@
 <templates xml:space="preserve">
 
     <t t-name="mail.ChatWindow" owl="1">
-        <div class="o_ChatWindow bg-white" t-attf-class="{{ className }}" tabindex="0" t-att-data-visible-index="chatWindow ? chatWindow.visibleIndex : undefined"
-            t-att-class="{
-                'o-focused': chatWindow and chatWindow.isFocused,
-                'o-folded': chatWindow and chatWindow.isFolded,
-                'o-fullscreen': props.isFullscreen,
-                'o-mobile': messaging and messaging.device.isMobile,
-                'o-new-message': chatWindow and !chatWindow.thread,
-            }" t-att-style="chatWindow ? chatWindow.componentStyle : undefined" t-on-keydown="_onKeydown" t-on-focusout="_onFocusout" t-att-data-chat-window-local-id="chatWindow ? chatWindow.localId : undefined" t-att-data-thread-local-id="chatWindow ? (chatWindow.thread ? chatWindow.thread.localId : '') : undefined" t-ref="root"
-        >
-            <t t-if="chatWindow">
+        <t t-if="chatWindow">
+            <div class="o_ChatWindow bg-white" t-attf-class="{{ className }}" tabindex="0" t-att-data-visible-index="chatWindow.visibleIndex"
+                t-att-class="{
+                    'o-focused': chatWindow.isFocused,
+                    'o-folded': chatWindow.isFolded,
+                    'o-fullscreen': props.isFullscreen,
+                    'o-mobile': messaging.device.isMobile,
+                    'o-new-message': !chatWindow.thread,
+                }" t-att-style="chatWindow.componentStyle" t-on-keydown="_onKeydown" t-on-focusout="_onFocusout" t-att-data-chat-window-local-id="chatWindow.localId" t-att-data-thread-local-id="chatWindow.thread ? chatWindow.thread.localId : ''" t-ref="root"
+            >
                 <ChatWindowHeader
                     className="'o_ChatWindow_header'"
                     chatWindowLocalId="chatWindow.localId"
@@ -49,8 +49,8 @@
                         />
                     </div>
                 </t>
-            </t>
-        </div>
+            </div>
+        </t>
     </t>
 
 </templates>
-- 
GitLab