FIX: chat activity indicator wasn't working for threads

When a user had the chat option "Show activity indicator in header" set to "all new messages", and they would get a reply to a thread they're part of, the chat icon in the header would not show the unread bubble indicator.

In order to fix this, the `ChatHeaderIconUnreadIndicator` component will now `showUnreadIndicator` whenever there is either one unread public channel or there are unread threads.

I only added a system spec for this very specific path because I don't want to slow down the whole suite to test for all the various combination of the `chat_header_indicator_preference` values.

Internal ref - t/128874
This commit is contained in:
Régis Hanol
2024-05-22 17:14:38 +02:00
parent 24230e7461
commit 0012d9626f
4 changed files with 54 additions and 5 deletions

View File

@ -13,6 +13,10 @@ module Chat
enum :desktop_notification_level, NOTIFICATION_LEVELS, prefix: :desktop_notifications
enum :mobile_notification_level, NOTIFICATION_LEVELS, prefix: :mobile_notifications
enum :join_mode, { manual: 0, automatic: 1 }
def mark_read!(new_last_read_id = nil)
update!(last_read_message_id: new_last_read_id || chat_channel.last_message_id)
end
end
end