Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,23 @@ export class StatementReviewDialogComponent implements OnInit {
showBalanceTab: false,
deletable: true,
onExpenseDelete: () => {
this.removeExpenseFromList(expense);
expenseDialog.close();
this.closeIfEmpty();
expenseDialog.close(true);
},
},
});

expenseDialog.onClose.subscribe((result: Expense | boolean | undefined) => {
if (!(result instanceof Expense)) {
if (!result) {
return;
}

this.removeExpenseFromList(expense);
this.calendarRefreshNeeded = true;
this.closeIfEmpty();
if (result instanceof Expense) {
this.calendarRefreshNeeded = true;
}

// Defer list mutation to the next tick so it does not run inside
// the same change detection cycle that is closing the dialog.
setTimeout(() => this.removeExpenseFromList(expense));
});
}

Expand Down Expand Up @@ -128,6 +130,7 @@ export class StatementReviewDialogComponent implements OnInit {

this.reloadGroupedExpenses();
this.onImportChange([...this.expenses]);
this.closeIfEmpty();
}

private reloadGroupedExpenses(): void {
Expand Down
Loading