Fix poll creation from a thread (#7706)
This commit is contained in:
parent
75b03ca101
commit
f0446a23d5
2 changed files with 18 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue