Fix issue deleting transactions
Fixes an issue where deleting a transaction on the transaction history screen would cause the application to freeze.
This commit is contained in:
@@ -23,16 +23,9 @@ interface TransactionCardProps {
|
||||
|
||||
const TransactionCard: React.FC<TransactionCardProps> = ({
|
||||
transaction,
|
||||
onUpdate
|
||||
}) => {
|
||||
const [isEditDialogOpen, setIsEditDialogOpen] = useState(false);
|
||||
const { title, amount, date, category, type } = transaction;
|
||||
|
||||
const handleSaveTransaction = (updatedTransaction: Transaction) => {
|
||||
if (onUpdate) {
|
||||
onUpdate(updatedTransaction);
|
||||
}
|
||||
};
|
||||
const { title, amount, date, category } = transaction;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -54,7 +47,6 @@ const TransactionCard: React.FC<TransactionCardProps> = ({
|
||||
transaction={transaction}
|
||||
open={isEditDialogOpen}
|
||||
onOpenChange={setIsEditDialogOpen}
|
||||
onSave={handleSaveTransaction}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user