mirror of https://github.com/vector-im/riot-web
Ensure iframe gets maximize/minimize events
parent
6ccce7142c
commit
987ee702d3
|
@ -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,
|
||||
});
|
||||
}
|
||||
// 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 {
|
||||
|
|
Loading…
Reference in New Issue