Skip to content
Merged
Show file tree
Hide file tree
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 @@ -74,12 +74,19 @@ export class StatementReviewDialogComponent implements OnInit {
});

expenseDialog.onClose.subscribe((savedExpense: Expense) => {
if (!savedExpense) {
if (!(savedExpense instanceof Expense)) {
return;
}

this.removeExpenseFromList(expense);
this.calendarRefreshNeeded = true;

if (!this.expenses.length) {
this.dialogRef.close({
action: DIALOG_ACTION_CLOSE,
calendarRefreshNeeded: this.calendarRefreshNeeded,
});
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ExpenseQueries } from '../../../queries/expense.queries';
import { StatementImportQueries } from '../../../queries/statement-import.queries';
import {
DIALOG_ACTION_CANCEL,
DIALOG_ACTION_CLOSE,
DIALOG_ACTION_IMPORT,
StatementReviewDialogComponent,
} from '../dialogs/statement-review-dialog/statement-review-dialog.component';
Expand Down Expand Up @@ -141,6 +142,13 @@ export class StatementImportService {
case DIALOG_ACTION_CANCEL:
this.clearImportStorage();
break;
case DIALOG_ACTION_CLOSE:
if (!this.expenses.length) {
this.clearImportStorage();
} else {
this.reloadImportStorage();
}
break;
}
});
}
Expand Down
Loading