narrow_banner: Refactor empty banner is: operands to use switch/case.

This commit is contained in:
YashRE42 2021-03-31 14:27:28 +00:00 committed by Tim Abbott
parent 00c493a75a
commit f85f0c4b0b
1 changed files with 12 additions and 11 deletions

View File

@ -109,15 +109,16 @@ function pick_empty_narrow_banner() {
// For other multi-operator narrows, we just use the default banner
return default_banner;
} else if (first_operator === "is") {
if (first_operand === "starred") {
switch (first_operand) {
case "starred":
// You have no starred messages.
return $("#empty_star_narrow_message");
} else if (first_operand === "mentioned") {
case "mentioned":
return $("#empty_narrow_all_mentioned");
} else if (first_operand === "private") {
case "private":
// You have no private messages.
return $("#empty_narrow_all_private_message");
} else if (first_operand === "unread") {
case "unread":
// You have no unread messages.
return $("#no_unread_narrow_message");
}