Skip to content

Commit 538d2b8

Browse files
committed
the add transaction page of mobile version supports the destinationAccountId and comment parameters
1 parent 30d36a3 commit 538d2b8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/lib/transaction.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
111111
}
112112
}
113113

114+
if (options.destinationAccountId && options.destinationAccountId !== '0') {
115+
for (const account of allVisibleAccounts) {
116+
if (account.id === options.destinationAccountId) {
117+
transaction.destinationAccountId = options.destinationAccountId;
118+
break;
119+
}
120+
}
121+
}
122+
114123
if (!transaction.sourceAccountId) {
115124
if (defaultAccountId && allAccountsMap[defaultAccountId] && !allAccountsMap[defaultAccountId].hidden) {
116125
transaction.sourceAccountId = defaultAccountId;
@@ -143,6 +152,10 @@ export function setTransactionModelByTransaction(transaction: Transaction, trans
143152
transaction.tagIds = finalTagIds;
144153
}
145154

155+
if (options.comment) {
156+
transaction.comment = options.comment;
157+
}
158+
146159
if (transaction2) {
147160
if (setContextData) {
148161
transaction.id = transaction2.id;

0 commit comments

Comments
 (0)