From dd58a4aa92edcad34605173f7852cd34f9599238 Mon Sep 17 00:00:00 2001 From: Marie Date: Sun, 13 Oct 2024 03:44:07 +0200 Subject: upd: add ability to refresh poll --- packages/backend/src/core/activitypub/models/ApQuestionService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/backend/src/core') diff --git a/packages/backend/src/core/activitypub/models/ApQuestionService.ts b/packages/backend/src/core/activitypub/models/ApQuestionService.ts index 73004d10b0..e3bff8a561 100644 --- a/packages/backend/src/core/activitypub/models/ApQuestionService.ts +++ b/packages/backend/src/core/activitypub/models/ApQuestionService.ts @@ -98,7 +98,7 @@ export class ApQuestionService { const newCount = apChoices.filter(ap => ap.name === choice).at(0)?.replies?.totalItems; if (newCount == null) throw new Error('invalid newCount: ' + newCount); - if (oldCount !== newCount) { + if (!(oldCount > newCount)) { changed = true; poll.votes[poll.choices.indexOf(choice)] = newCount; } -- cgit v1.2.3-freya From 6b561639316439eba75be3205f524d57b85c3735 Mon Sep 17 00:00:00 2001 From: Marie Date: Sun, 13 Oct 2024 11:12:23 +0200 Subject: upd: change condition --- packages/backend/src/core/activitypub/models/ApQuestionService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/backend/src/core') diff --git a/packages/backend/src/core/activitypub/models/ApQuestionService.ts b/packages/backend/src/core/activitypub/models/ApQuestionService.ts index e3bff8a561..9246398fde 100644 --- a/packages/backend/src/core/activitypub/models/ApQuestionService.ts +++ b/packages/backend/src/core/activitypub/models/ApQuestionService.ts @@ -98,7 +98,7 @@ export class ApQuestionService { const newCount = apChoices.filter(ap => ap.name === choice).at(0)?.replies?.totalItems; if (newCount == null) throw new Error('invalid newCount: ' + newCount); - if (!(oldCount > newCount)) { + if (oldCount <= newCount) { changed = true; poll.votes[poll.choices.indexOf(choice)] = newCount; } -- cgit v1.2.3-freya