From 78b475740bec54f76ba100e3cdff6f8dae0183c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 16 Dec 2025 01:10:47 +0100 Subject: [PATCH] Replace notify method by binded version in constructor of chat and notification menu We need to keep a reference to the binded method registered to be able to unregister it. Closes #14425 --- sao/src/chat.js | 3 ++- sao/src/notification.js | 1 + sao/src/sao.js | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sao/src/chat.js b/sao/src/chat.js index bc27560ae4..461a85fccd 100644 --- a/sao/src/chat.js +++ b/sao/src/chat.js @@ -5,8 +5,9 @@ class _Chat { constructor(record) { + this.notify = this.notify.bind(this); this.record = record; - Sao.Bus.register(`chat:${this.record}`, this.notify.bind(this)); + Sao.Bus.register(`chat:${this.record}`, this.notify); this.el = this.__build(); } diff --git a/sao/src/notification.js b/sao/src/notification.js index 9e828bd32d..e6ed4af2e3 100644 --- a/sao/src/notification.js +++ b/sao/src/notification.js @@ -6,6 +6,7 @@ class _NotificationMenu { constructor() { + this.notify = this.notify.bind(this); this.el = jQuery('