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

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-11-20 19:01:19 +00:00
committed by GitHub
parent 72989ea646
commit d8844c682b

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 [];
} }