use the first visible account as default if the default account is hidden when creating new transaction
This commit is contained in:
@@ -112,7 +112,7 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
|
||||
}
|
||||
|
||||
if (!transaction.sourceAccountId) {
|
||||
if (defaultAccountId && allAccountsMap[defaultAccountId]) {
|
||||
if (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
|
||||
transaction.sourceAccountId = defaultAccountId;
|
||||
} else {
|
||||
transaction.sourceAccountId = allVisibleAccounts[0].id;
|
||||
@@ -120,7 +120,7 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
|
||||
}
|
||||
|
||||
if (!transaction.destinationAccountId) {
|
||||
if (defaultAccountId && allAccountsMap[defaultAccountId]) {
|
||||
if (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
|
||||
transaction.destinationAccountId = defaultAccountId;
|
||||
} else {
|
||||
transaction.destinationAccountId = allVisibleAccounts[0].id;
|
||||
|
||||
Reference in New Issue
Block a user