mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
message_list_view: Move "is_search_view" to narrow_state.
This helper function is only ever used to describe the current view, so it might as well be in the module for such views. Also added the test coverage for "is_search_view".
This commit is contained in:
@@ -428,14 +428,6 @@ function maybe_restore_focus_to_message_edit_form(): void {
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function is_search_view(): boolean {
|
||||
const current_filter = narrow_state.filter();
|
||||
if (current_filter && !current_filter.supports_collapsing_recipients()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
type SubscriptionMarkers = {
|
||||
bookend_top: boolean;
|
||||
stream_name: string;
|
||||
@@ -456,7 +448,7 @@ function populate_group_from_message(
|
||||
|
||||
// Each searched message is a self-contained result,
|
||||
// so we always display date in the recipient bar for those messages.
|
||||
const always_display_date = is_search_view();
|
||||
const always_display_date = narrow_state.is_search_view();
|
||||
if (is_stream) {
|
||||
assert(message.type === "stream");
|
||||
// stream messages have string display_recipient
|
||||
|
||||
Reference in New Issue
Block a user