mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
typeahead_helper: Clean up current_stream check.
Followup for https://github.com/zulip/zulip/pull/29650/files#r1569209419
This commit is contained in:
@@ -311,11 +311,9 @@ export function sort_people_for_relevance<UserType extends UserOrMentionPillData
|
||||
current_topic?: string,
|
||||
): UserType[] {
|
||||
// If sorting for recipientbox typeahead and not viewing a stream / topic, then current_stream = ""
|
||||
let current_stream = null;
|
||||
if (current_stream_id) {
|
||||
current_stream = stream_data.get_sub_by_id(current_stream_id);
|
||||
}
|
||||
if (!current_stream) {
|
||||
const current_stream =
|
||||
current_stream_id !== undefined ? stream_data.get_sub_by_id(current_stream_id) : undefined;
|
||||
if (current_stream === undefined) {
|
||||
objs.sort((person_a, person_b) => compare_people_for_relevance(person_a, person_b));
|
||||
} else {
|
||||
assert(current_stream_id !== undefined);
|
||||
|
||||
Reference in New Issue
Block a user