PERF: Only subscribe to `/new` when logged in (#16028)

The 'new' tab doesn't exist for anonymous users. Every 'new' topic also publishes a message on the `/latest` channel, so the blue banner at the top of the topic-list will still be functional
This commit is contained in:
David Taylor 2022-02-22 19:35:59 +00:00 committed by GitHub
parent e4d10a1f5f
commit 3712c958fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -65,9 +65,9 @@ const TopicTrackingState = EmberObject.extend({
* @method establishChannels
*/
establishChannels() {
this.messageBus.subscribe("/new", this._processChannelPayload);
this.messageBus.subscribe("/latest", this._processChannelPayload);
if (this.currentUser) {
this.messageBus.subscribe("/new", this._processChannelPayload);
this.messageBus.subscribe(`/unread`, this._processChannelPayload);
this.messageBus.subscribe(
`/unread/${this.currentUser.id}`,