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:
ryanreh99
2020-10-10 18:25:42 +05:30
committed by Tim Abbott
parent a8106a641b
commit e4d5ea69a0
4 changed files with 5 additions and 38 deletions

View File

@@ -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)) {

View File

@@ -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);
}