From 2cc8c8d78ef797ad3d01d3be657cf0613fd1e50e Mon Sep 17 00:00:00 2001 From: Amandee Ellawala Date: Tue, 29 Oct 2024 00:40:29 +0000 Subject: [PATCH] Fix #194: Update Sum row immediately when user making changes --- .../app/poll/choose-events/choose-events.component.html | 1 + .../app/poll/choose-events/choose-events.component.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/apps/frontend/src/app/poll/choose-events/choose-events.component.html b/apps/frontend/src/app/poll/choose-events/choose-events.component.html index f8810e54..c94222a8 100644 --- a/apps/frontend/src/app/poll/choose-events/choose-events.component.html +++ b/apps/frontend/src/app/poll/choose-events/choose-events.component.html @@ -76,6 +76,7 @@

[canParticipate]="!closedReason" [token]="token" [bestOption]="bestOption" + (changed)="onTableChange()" > } @case ("events") { diff --git a/apps/frontend/src/app/poll/choose-events/choose-events.component.ts b/apps/frontend/src/app/poll/choose-events/choose-events.component.ts index 0c19e998..630e3134 100644 --- a/apps/frontend/src/app/poll/choose-events/choose-events.component.ts +++ b/apps/frontend/src/app/poll/choose-events/choose-events.component.ts @@ -204,4 +204,13 @@ export class ChooseEventsComponent implements OnInit { private userVoted(): boolean { return this.participants?.some(participant => participant.token === this.token) ?? false; } + + onTableChange() { + if(this.poll) { + this.pollService.getEvents(this.poll._id).subscribe((events)=>{ + this.pollEvents = events; + this.updateHelpers(); + }) + } + } }