Use doMaybeLocalRoomAction (#9038)
* Use doMaybeLocalRoomAction * Revert unnecessary changes
This commit is contained in:
parent
9b8b8763f7
commit
3be20cf434
12 changed files with 333 additions and 22 deletions
|
@ -35,6 +35,7 @@ import { arrayFastClone, arraySeed } from "../../../utils/arrays";
|
|||
import Field from "./Field";
|
||||
import AccessibleButton from "./AccessibleButton";
|
||||
import Spinner from "./Spinner";
|
||||
import { doMaybeLocalRoomAction } from "../../../utils/local-room";
|
||||
|
||||
interface IProps extends IDialogProps {
|
||||
room: Room;
|
||||
|
@ -163,11 +164,15 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
|
|||
protected submit(): void {
|
||||
this.setState({ busy: true, canSubmit: false });
|
||||
const pollEvent = this.createEvent();
|
||||
this.matrixClient.sendEvent(
|
||||
doMaybeLocalRoomAction(
|
||||
this.props.room.roomId,
|
||||
this.props.threadId,
|
||||
pollEvent.type,
|
||||
pollEvent.content,
|
||||
(actualRoomId: string) => this.matrixClient.sendEvent(
|
||||
actualRoomId,
|
||||
this.props.threadId,
|
||||
pollEvent.type,
|
||||
pollEvent.content,
|
||||
),
|
||||
this.matrixClient,
|
||||
).then(
|
||||
() => this.props.onFinished(true),
|
||||
).catch(e => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue