use for-of statements to replace for and for-in
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ export function useReconciliationStatementPageBase() {
|
||||
let currency = defaultCurrency.value;
|
||||
|
||||
if (allAccountsMap.value[transaction.sourceAccountId]) {
|
||||
currency = allAccountsMap.value[transaction.sourceAccountId].currency;
|
||||
currency = allAccountsMap.value[transaction.sourceAccountId]!.currency;
|
||||
}
|
||||
|
||||
return formatAmountToLocalizedNumeralsWithCurrency(transaction.sourceAmount, currency);
|
||||
@@ -160,7 +160,7 @@ export function useReconciliationStatementPageBase() {
|
||||
let currency = defaultCurrency.value;
|
||||
|
||||
if (allAccountsMap.value[transaction.destinationAccountId]) {
|
||||
currency = allAccountsMap.value[transaction.destinationAccountId].currency;
|
||||
currency = allAccountsMap.value[transaction.destinationAccountId]!.currency;
|
||||
}
|
||||
|
||||
return formatAmountToLocalizedNumeralsWithCurrency(transaction.destinationAmount, currency);
|
||||
@@ -172,12 +172,12 @@ export function useReconciliationStatementPageBase() {
|
||||
|
||||
if (transaction.type === TransactionType.Transfer && transaction.destinationAccountId === accountId.value) {
|
||||
if (allAccountsMap.value[transaction.destinationAccountId]) {
|
||||
currency = allAccountsMap.value[transaction.destinationAccountId].currency;
|
||||
isLiabilityAccount = allAccountsMap.value[transaction.destinationAccountId].isLiability;
|
||||
currency = allAccountsMap.value[transaction.destinationAccountId]!.currency;
|
||||
isLiabilityAccount = allAccountsMap.value[transaction.destinationAccountId]!.isLiability;
|
||||
}
|
||||
} else if (allAccountsMap.value[transaction.sourceAccountId]) {
|
||||
currency = allAccountsMap.value[transaction.sourceAccountId].currency;
|
||||
isLiabilityAccount = allAccountsMap.value[transaction.sourceAccountId].isLiability;
|
||||
currency = allAccountsMap.value[transaction.sourceAccountId]!.currency;
|
||||
isLiabilityAccount = allAccountsMap.value[transaction.sourceAccountId]!.isLiability;
|
||||
}
|
||||
|
||||
if (isLiabilityAccount) {
|
||||
|
||||
Reference in New Issue
Block a user