Renamed the hasAnyMatched variable to isAnyMatched in the JavaScript #filterOptions method of the BaseAccountSelector, RecurringAccountSelector, and OriginalLineItemSelector classes.

This commit is contained in:
依瑪貓 2023-03-24 06:52:14 +08:00
parent a9afc385e9
commit 7459afd63a
3 changed files with 9 additions and 9 deletions

View File

@ -296,16 +296,16 @@ class BaseAccountSelector {
* *
*/ */
#filterOptions() { #filterOptions() {
let hasAnyMatched = false; let isAnyMatched = false;
for (const option of this.#options) { for (const option of this.#options) {
if (option.isMatched(this.#query.value)) { if (option.isMatched(this.#query.value)) {
option.setShown(true); option.setShown(true);
hasAnyMatched = true; isAnyMatched = true;
} else { } else {
option.setShown(false); option.setShown(false);
} }
} }
if (!hasAnyMatched) { if (!isAnyMatched) {
this.#optionList.classList.add("d-none"); this.#optionList.classList.add("d-none");
this.#queryNoResult.classList.remove("d-none"); this.#queryNoResult.classList.remove("d-none");
} else { } else {

View File

@ -898,16 +898,16 @@ class RecurringAccountSelector {
* *
*/ */
#filterOptions() { #filterOptions() {
let hasAnyMatched = false; let isAnyMatched = false;
for (const option of this.#options) { for (const option of this.#options) {
if (option.isMatched(this.#query.value)) { if (option.isMatched(this.#query.value)) {
option.setShown(true); option.setShown(true);
hasAnyMatched = true; isAnyMatched = true;
} else { } else {
option.setShown(false); option.setShown(false);
} }
} }
if (!hasAnyMatched) { if (!isAnyMatched) {
this.#optionList.classList.add("d-none"); this.#optionList.classList.add("d-none");
this.#queryNoResult.classList.remove("d-none"); this.#queryNoResult.classList.remove("d-none");
} else { } else {

View File

@ -155,16 +155,16 @@ class OriginalLineItemSelector {
* *
*/ */
#filterOptions() { #filterOptions() {
let hasAnyMatched = false; let isAnyMatched = false;
for (const option of this.#options) { for (const option of this.#options) {
if (option.isMatched(this.#debitCredit, this.#currencyCode, this.#query.value)) { if (option.isMatched(this.#debitCredit, this.#currencyCode, this.#query.value)) {
option.setShown(true); option.setShown(true);
hasAnyMatched = true; isAnyMatched = true;
} else { } else {
option.setShown(false); option.setShown(false);
} }
} }
if (!hasAnyMatched) { if (!isAnyMatched) {
this.#optionList.classList.add("d-none"); this.#optionList.classList.add("d-none");
this.#queryNoResult.classList.remove("d-none"); this.#queryNoResult.classList.remove("d-none");
} else { } else {