fix(giving): reset in-buffer line-edit index on reopen/cancel/submit

This commit is contained in:
Chris Chen
2026-05-28 17:44:43 -07:00
parent af21e50d9f
commit 48885dba83
@@ -106,6 +106,7 @@ export class OfferingSessionPageComponent implements OnInit {
cancelEdit(): void { cancelEdit(): void {
this.editingSessionId = null; this.editingSessionId = null;
this.editingIndex = null;
this.buffer = []; this.cashTotal = 0; this.checkTotal = 0; this.notes = null; this.buffer = []; this.cashTotal = 0; this.checkTotal = 0; this.notes = null;
this.sessionDate = new Date(); this.sessionDate = new Date();
this.checkDate(); this.checkDate();
@@ -192,6 +193,7 @@ export class OfferingSessionPageComponent implements OnInit {
this.submitting = false; this.submitting = false;
alert(this.editingSessionId != null ? 'Offering session updated.' : 'Offering session submitted.'); alert(this.editingSessionId != null ? 'Offering session updated.' : 'Offering session submitted.');
this.editingSessionId = null; this.editingSessionId = null;
this.editingIndex = null;
this.buffer = []; this.cashTotal = 0; this.checkTotal = 0; this.notes = null; this.buffer = []; this.cashTotal = 0; this.checkTotal = 0; this.notes = null;
this.sessionDate = new Date(); this.sessionDate = new Date();
this.checkDate(); this.checkDate();
@@ -205,6 +207,7 @@ export class OfferingSessionPageComponent implements OnInit {
} }
private resetEntry(): void { private resetEntry(): void {
this.editingIndex = null;
this.selectedMemberId = null; this.selectedMemberName = null; this.memberResults = []; this.selectedMemberId = null; this.selectedMemberName = null; this.memberResults = [];
this.entry = this.blankEntry(); this.entry = this.blankEntry();
this.entry.givingCategoryId = this.categories[0]?.id ?? 0; this.entry.givingCategoryId = this.categories[0]?.id ?? 0;