Merge pull request #6219 from matrix-org/t3chguy/ts/6

Fix ConfirmUserActionDialog returning an input field rather than text
This commit is contained in:
Michael Telatynski 2021-06-21 08:53:43 +01:00 committed by GitHub
commit b380e43e4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ interface IProps {
// be the string entered. // be the string entered.
askReason?: boolean; askReason?: boolean;
danger?: boolean; danger?: boolean;
onFinished: (success: boolean, reason?: HTMLInputElement) => void; onFinished: (success: boolean, reason?: string) => void;
} }
/* /*
@ -59,11 +59,7 @@ export default class ConfirmUserActionDialog extends React.Component<IProps> {
}; };
public onOk = (): void => { public onOk = (): void => {
let reason; this.props.onFinished(true, this.reasonField.current?.value);
if (this.reasonField) {
reason = this.reasonField.current;
}
this.props.onFinished(true, reason);
}; };
public onCancel = (): void => { public onCancel = (): void => {