Simplified the code in the #resetDeleteCurrencyButtons method of the JavaScript TransactionForm form.

This commit is contained in:
依瑪貓 2023-03-18 03:55:55 +08:00
parent 2e5f9ee01f
commit e1d1aff0c1

View File

@ -159,15 +159,14 @@ class TransactionForm {
this.#currencies[0].deleteButton.classList.add("d-none");
} else {
for (const currency of this.#currencies) {
const isAnyEntryMatched = () => {
for (const entry of currency.getEntries()) {
if (entry.isMatched) {
return true;
}
let isAnyEntryMatched = false;
for (const entry of currency.getEntries()) {
if (entry.isMatched) {
isAnyEntryMatched = true;
break;
}
return false;
};
if (isAnyEntryMatched()) {
}
if (isAnyEntryMatched) {
currency.deleteButton.classList.add("d-none");
} else {
currency.deleteButton.classList.remove("d-none");