top_left_corner: Don't export `should_expand_pm_list()`.

We don't need to export `should_expand_pm_list` function
since we are not using it anywhere else.
This commit is contained in:
Hashir Sarwar 2020-02-02 16:17:28 +05:00 committed by Tim Abbott
parent 4a36ed6cb2
commit 6e14c39468
1 changed files with 22 additions and 22 deletions

View File

@ -42,6 +42,27 @@ function deselect_top_left_corner_items() {
remove($('.top_left_mentions'));
}
function should_expand_pm_list(filter) {
const op_is = filter.operands('is');
if (op_is.length >= 1 && op_is.includes("private")) {
return true;
}
const op_pm = filter.operands('pm-with');
if (op_pm.length !== 1) {
return false;
}
const emails_strings = op_pm[0];
const emails = emails_strings.split(',');
const has_valid_emails = people.is_valid_bulk_emails_for_compose(emails);
return has_valid_emails;
}
exports.handle_narrow_activated = function (filter) {
deselect_top_left_corner_items();
@ -70,34 +91,13 @@ exports.handle_narrow_activated = function (filter) {
}
}
if (exports.should_expand_pm_list(filter)) {
if (should_expand_pm_list(filter)) {
pm_list.expand();
} else {
pm_list.close();
}
};
exports.should_expand_pm_list = function (filter) {
const op_is = filter.operands('is');
if (op_is.length >= 1 && op_is.includes("private")) {
return true;
}
const op_pm = filter.operands('pm-with');
if (op_pm.length !== 1) {
return false;
}
const emails_strings = op_pm[0];
const emails = emails_strings.split(',');
const has_valid_emails = people.is_valid_bulk_emails_for_compose(emails);
return has_valid_emails;
};
exports.handle_narrow_deactivated = function () {
deselect_top_left_corner_items();
pm_list.close();