Fix poll creation from a thread (#7706)

This commit is contained in:
Germain 2022-02-02 17:55:41 +00:00 committed by GitHub
parent 75b03ca101
commit f0446a23d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View file

@ -30,6 +30,7 @@ import Spinner from "./Spinner";
interface IProps extends IDialogProps {
room: Room;
threadId?: string;
}
interface IState extends IScrollableBaseState {
@ -103,7 +104,12 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
this.state.options.map(a => a.trim()).filter(a => !!a),
M_POLL_KIND_DISCLOSED,
).serialize();
this.matrixClient.sendEvent(this.props.room.roomId, pollEvent.type, pollEvent.content).then(
this.matrixClient.sendEvent(
this.props.room.roomId,
this.props.threadId,
pollEvent.type,
pollEvent.content,
).then(
() => this.props.onFinished(true),
).catch(e => {
console.error("Failed to post poll:", e);