Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: display last message when searching for the rooms #42476

Merged
merged 5 commits into from
Jun 3, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,15 @@ function getAlternateText(option: ReportUtils.OptionData, {showChatPreviewLine =
if (!!option.isThread || !!option.isMoneyRequestReport) {
return option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'report.noActivityYet');
}
if (!!option.isChatRoom || !!option.isPolicyExpenseChat) {

if (option.isChatRoom) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only need to do this for chat rooms that aren't #admins and #announce, for those I believe we still want to display the policy name

return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : option.subtitle;
}

if (option.isPolicyExpenseChat) {
return showChatPreviewLine && !forcePolicyNamePreview && option.lastMessageText ? option.lastMessageText : option.subtitle;
}

if (option.isTaskReport) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'report.noActivityYet');
}
Expand Down
Loading