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:
parent
72989ea646
commit
d8844c682b
1 changed files with 4 additions and 1 deletions
|
@ -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 [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue