Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix_some_specific_crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Fix poll crashing sable if interacted with different clients
2 changes: 1 addition & 1 deletion src/app/components/RenderMessageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ function RenderMessageContentInternal({
if (content['org.matrix.msc3381.poll.start']) {
if (mEvent && mx && room)
return <PollEvent content={content} mEvent={mEvent} mx={mx} room={room} />;
else return <UnsupportedContent body="abba" />;
else return <UnsupportedContent />;
}
return (
<UnsupportedContent
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/message/PollEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export function PollEvent({ content, mEvent, mx, room }: PollEventProps) {
let endText = 'The Poll has ended and';
const winnerArray = answers.filter((item) => votes[item.id] === maxValue);
if (maxValue === 0) endText += ' nobody voted';
else if (winnerArray.length === 1 && winnerArray[0])
else if (winnerArray.length === 1 && winnerArray[0] && winnerArray[0][M_TEXT.name])
endText += `${winnerArray[0][M_TEXT.name]} won`;
else {
endText += ': ';
Expand Down
Loading