Merge branch 'pr-72'

This commit is contained in:
Felipe Coutinho
2026-05-23 12:57:47 -03:00

View File

@@ -124,10 +124,11 @@ interface TransactionRow {
function createEmptyTransactionRow( function createEmptyTransactionRow(
defaultPayerId?: string | null, defaultPayerId?: string | null,
lastPurchaseDate?: string,
): TransactionRow { ): TransactionRow {
return { return {
id: createClientSafeId(), id: createClientSafeId(),
purchaseDate: getTodayDateString(), purchaseDate: lastPurchaseDate ?? getTodayDateString(),
name: "", name: "",
amount: "", amount: "",
categoryId: undefined, categoryId: undefined,
@@ -194,9 +195,10 @@ export function MassAddDialog({
}; };
const addTransaction = () => { const addTransaction = () => {
const lastTransaction = transactions[transactions.length - 1];
setTransactions([ setTransactions([
...transactions, ...transactions,
createEmptyTransactionRow(defaultPayerId), createEmptyTransactionRow(defaultPayerId, lastTransaction?.purchaseDate),
]); ]);
setIsDirty(true); setIsDirty(true);
}; };