mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
refactor: Remove redundant typeahead_helper.sort_recipientbox_typeahead.
This commit removes`typeahead_helper.sort_recipientbox_typeahead`
which was introduced in 639ec9380a
for the private message recipient box when it used to accept comma
separated text input for recipients. All it doew was cleaning away
invalid recipients from string, like:
"a, , b" was cleaned to [a, b].
This can be now removed because it was now used only in
pill_typeahead.setup code path, and the pills code already handles
invalid cases by filtering out all falsy (invalid) recipients.
This commit is contained in:
@@ -51,7 +51,7 @@ export function set_up(input, pills, opts) {
|
||||
return typeahead_helper.sort_streams(matches, this.query.trim().slice(1));
|
||||
}
|
||||
|
||||
return typeahead_helper.sort_recipientbox_typeahead(this.query, matches, "");
|
||||
return typeahead_helper.sort_recipients(matches, this.query, "");
|
||||
},
|
||||
updater(item) {
|
||||
if (include_streams(this.query)) {
|
||||
|
||||
@@ -380,10 +380,3 @@ export function sort_streams(matches, query) {
|
||||
|
||||
return name_results.matches.concat(desc_results.matches.concat(desc_results.rest));
|
||||
}
|
||||
|
||||
export function sort_recipientbox_typeahead(query, matches, current_stream) {
|
||||
// input_text may be one or more pm recipients
|
||||
const cleaned = get_cleaned_pm_recipients(query);
|
||||
query = cleaned[cleaned.length - 1];
|
||||
return sort_recipients(matches, query, current_stream);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user