Filter out redacted poll votes to avoid crashing the Poll widget (#28498)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/28509/head
Michael Telatynski 2024-11-20 19:01:19 +00:00 committed by GitHub
parent 72989ea646
commit d8844c682b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -383,7 +383,10 @@ function userResponseFromPollResponseEvent(event: MatrixEvent): UserVote {
export function allVotes(voteRelations: Relations): Array<UserVote> { export function allVotes(voteRelations: Relations): Array<UserVote> {
if (voteRelations) { if (voteRelations) {
return voteRelations.getRelations().map(userResponseFromPollResponseEvent); return voteRelations
.getRelations()
.filter((e) => !e.isRedacted())
.map(userResponseFromPollResponseEvent);
} else { } else {
return []; return [];
} }