From 67913e59e0065c19eb15bc693f5e6ac5456c6224 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 23 Mar 2023 11:11:13 +0100 Subject: [PATCH] FIX: relies only on message bus to set tracking state (#20785) This manual set was happening only after the request so was not much faster than just waiting on message bus update. It's not by itself changing any behavior or fixing any bug but it makes reasoning about the whole state easier as it happens in only one central place. --- .../chat/assets/javascripts/discourse/models/chat-channel.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/chat/assets/javascripts/discourse/models/chat-channel.js b/plugins/chat/assets/javascripts/discourse/models/chat-channel.js index 5c629cf8d67..eaa0f116227 100644 --- a/plugins/chat/assets/javascripts/discourse/models/chat-channel.js +++ b/plugins/chat/assets/javascripts/discourse/models/chat-channel.js @@ -172,8 +172,6 @@ export default class ChatChannel extends RestModel { // class not to use RestModel return ajax(`/chat/api/channels/${this.id}/read/${messageId}`, { method: "PUT", - }).then(() => { - this.currentUserMembership.last_read_message_id = messageId; }); } }