use for-of statements to replace for and for-in

This commit is contained in:
MaysWind
2025-09-09 23:48:42 +08:00
parent c75a902d84
commit 34c5a1750e
50 changed files with 368 additions and 460 deletions
@@ -52,8 +52,8 @@ export function useAccountEditPageBaseBase() {
}
if (account.value.type === AccountType.MultiSubAccounts.type) {
for (let i = 0; i < subAccounts.value.length; i++) {
problemMessage = getInputEmptyProblemMessage(subAccounts.value[i], true);
for (const subAccount of subAccounts.value) {
problemMessage = getInputEmptyProblemMessage(subAccount, true);
if (problemMessage) {
return problemMessage;
@@ -132,9 +132,9 @@ export function useAccountEditPageBaseBase() {
subAccounts.value = [];
if (newAccount.subAccounts && newAccount.subAccounts.length > 0) {
for (let i = 0; i < newAccount.subAccounts.length; i++) {
for (const oldSubAccount of newAccount.subAccounts) {
const subAccount: Account = account.value.createNewSubAccount(userStore.currentUserDefaultCurrency, getCurrentUnixTime());
subAccount.fillFrom(newAccount.subAccounts[i]);
subAccount.fillFrom(oldSubAccount);
subAccounts.value.push(subAccount);
}