You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Ensure iframe gets maximize/minimize events
This commit is contained in:
@@ -64,10 +64,14 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
||||
this.onAccountDetailsRequest();
|
||||
break;
|
||||
case PostmessageAction.Maximize:
|
||||
this.maximizeDialog();
|
||||
this.setState({
|
||||
minimized: false,
|
||||
});
|
||||
break;
|
||||
case PostmessageAction.Minimize:
|
||||
this.minimizeDialog();
|
||||
this.setState({
|
||||
minimized: true,
|
||||
});
|
||||
break;
|
||||
case PostmessageAction.SetupComplete:
|
||||
// Set as completed but let the user close the modal themselves
|
||||
@@ -82,17 +86,23 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
||||
}
|
||||
|
||||
private maximizeDialog = () => {
|
||||
if (this.state.minimized) {
|
||||
this.setState({
|
||||
minimized: false,
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
minimized: false,
|
||||
});
|
||||
// Send this action to the iframe so it can act accordingly
|
||||
this.sendMessage({
|
||||
action: PostmessageAction.Maximize,
|
||||
});
|
||||
}
|
||||
|
||||
private minimizeDialog = () => {
|
||||
this.setState({
|
||||
minimized: true,
|
||||
});
|
||||
// Send this action to the iframe so it can act accordingly
|
||||
this.sendMessage({
|
||||
action: PostmessageAction.Minimize,
|
||||
});
|
||||
}
|
||||
|
||||
private closeDialog = async () => {
|
||||
|
||||
@@ -38,7 +38,7 @@ export interface IPostmessageRequestData {
|
||||
|
||||
export interface IPostmessageResponseData {
|
||||
action: PostmessageAction;
|
||||
account: IAccountData;
|
||||
account?: IAccountData;
|
||||
}
|
||||
|
||||
export interface IPostmessage {
|
||||
|
||||
Reference in New Issue
Block a user