mirror of https://github.com/vector-im/riot-web
Filter out redacted poll votes to avoid crashing the Poll widget (#28498)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/28509/head
parent
72989ea646
commit
d8844c682b
|
@ -383,7 +383,10 @@ function userResponseFromPollResponseEvent(event: MatrixEvent): UserVote {
|
|||
|
||||
export function allVotes(voteRelations: Relations): Array<UserVote> {
|
||||
if (voteRelations) {
|
||||
return voteRelations.getRelations().map(userResponseFromPollResponseEvent);
|
||||
return voteRelations
|
||||
.getRelations()
|
||||
.filter((e) => !e.isRedacted())
|
||||
.map(userResponseFromPollResponseEvent);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue