Skip to content

A platform for community discussion. Free, open, simple.

PERF: Remove unused MessageBus subs to PM unread indicator channels (#36376)

Osama Sayeghf5ec7f71b89a
diff --git a/frontend/discourse/app/components/basic-topic-list.gjs b/frontend/discourse/app/components/basic-topic-list.gjs
index 8d99b007b10..f602bb4e664 100644
--- a/frontend/discourse/app/components/basic-topic-list.gjs
+++ b/frontend/discourse/app/components/basic-topic-list.gjs
@@ -6,7 +6,7 @@ import { observes } from "@ember-decorators/object";
import $ from "jquery";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import List from "discourse/components/topic-list/list";
-import discourseComputed, { bind } from "discourse/lib/decorators";
+import discourseComputed from "discourse/lib/decorators";
import { i18n } from "discourse-i18n";
export default class BasicTopicList extends Component {
@@ -46,37 +46,6 @@ export default class BasicTopicList extends Component {
}
}
- didInsertElement() {
- super.didInsertElement(...arguments);
-
- this.topics.forEach((topic) => {
- if (typeof topic.unread_by_group_member !== "undefined") {
- this.messageBus.subscribe(
- `/private-messages/unread-indicator/${topic.id}`,
- this.onMessage
- );
- }
- });
- }
-
- willDestroyElement() {
- super.willDestroyElement(...arguments);
-
- this.messageBus.unsubscribe(
- "/private-messages/unread-indicator/*",
- this.onMessage
- );
- }
-
- @bind
- onMessage(data) {
- const nodeClassList = document.querySelector(
- `.indicator-topic-${data.topic_id}`
- ).classList;
-
- nodeClassList.toggle("read", !data.show_indicator);
- }
-
@discourseComputed("topics")
showUnreadIndicator(topics) {
return topics.some(