From b7f76d99e8520089f250c2ef06174b20ef70212f Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 23 Oct 2024 17:16:08 +0100 Subject: [PATCH] DEV: Delete unused rerender-on-do-not-disturb-change mixin (#29373) This was used in the old header/user-menu implementation. It can now be removed --- .../rerender-on-do-not-disturb-change.js | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 app/assets/javascripts/discourse/app/mixins/rerender-on-do-not-disturb-change.js diff --git a/app/assets/javascripts/discourse/app/mixins/rerender-on-do-not-disturb-change.js b/app/assets/javascripts/discourse/app/mixins/rerender-on-do-not-disturb-change.js deleted file mode 100644 index 9feb426cb7d..00000000000 --- a/app/assets/javascripts/discourse/app/mixins/rerender-on-do-not-disturb-change.js +++ /dev/null @@ -1,37 +0,0 @@ -import Mixin from "@ember/object/mixin"; -import { cancel } from "@ember/runloop"; -import { isTesting } from "discourse-common/config/environment"; -import discourseLater from "discourse-common/lib/later"; - -export default Mixin.create({ - _listenToDoNotDisturbLoop: null, - - listenForDoNotDisturbChanges() { - if (this.currentUser && !this.currentUser.isInDoNotDisturb()) { - this.queueRerender(); - } else { - cancel(this._listenToDoNotDisturbLoop); - this._listenToDoNotDisturbLoop = discourseLater( - this, - () => { - this.listenForDoNotDisturbChanges(); - }, - 10000 - ); - } - }, - - didInsertElement() { - this._super(...arguments); - - this.appEvents.on("do-not-disturb:changed", () => this.queueRerender()); - if (!isTesting()) { - this.listenForDoNotDisturbChanges(); - } - }, - - willDestroyElement() { - this._super(...arguments); - cancel(this._listenToDoNotDisturbLoop); - }, -});