From 2bc10b5328e153b64abe0e088eb34800fcb470ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Tue, 3 Jan 2023 12:14:15 +0000 Subject: [PATCH] [FIX] mail: load emoji data on focusing composer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, typing an emoji source in composer like emoticon `:)`, it may not substitute to the corresponding emoji. This happens because the emoji substitution requires loading emoji data. It was only loaded when opening the emoji picker. This commit fixes the issue by lazy loading emoji data when focusing the composer. closes odoo/odoo#109035 X-original-commit: 066e8029c0d66974c59bfe9e430affb4bf0604b9 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/composer_view.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/static/src/models/composer_view.js b/addons/mail/static/src/models/composer_view.js index ef8b3529c72..21dc7f63da5 100644 --- a/addons/mail/static/src/models/composer_view.js +++ b/addons/mail/static/src/models/composer_view.js @@ -291,6 +291,9 @@ Model({ if (!this.exists()) { return; } + if (!this.messaging.emojiRegistry.isLoaded && !this.messaging.emojiRegistry.isLoading) { + this.messaging.emojiRegistry.loadEmojiData(); + } this.update({ isFocused: true }); }, onFocusoutTextarea() {