From 987ee702d3287d5cf0733cf20ee4283c0302a8c7 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Thu, 4 Feb 2021 18:30:12 +0200 Subject: [PATCH] Ensure iframe gets maximize/minimize events --- .../views/dialogs/HostSignupDialog.tsx | 24 +++++++++++++------ .../views/dialogs/HostSignupDialogTypes.ts | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/components/views/dialogs/HostSignupDialog.tsx b/src/components/views/dialogs/HostSignupDialog.tsx index 7a7dfaa2de..1feec1857c 100644 --- a/src/components/views/dialogs/HostSignupDialog.tsx +++ b/src/components/views/dialogs/HostSignupDialog.tsx @@ -64,10 +64,14 @@ export default class HostSignupDialog extends React.PureComponent { - 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 () => { diff --git a/src/components/views/dialogs/HostSignupDialogTypes.ts b/src/components/views/dialogs/HostSignupDialogTypes.ts index 94a4f5e2f6..e1d51a3906 100644 --- a/src/components/views/dialogs/HostSignupDialogTypes.ts +++ b/src/components/views/dialogs/HostSignupDialogTypes.ts @@ -38,7 +38,7 @@ export interface IPostmessageRequestData { export interface IPostmessageResponseData { action: PostmessageAction; - account: IAccountData; + account?: IAccountData; } export interface IPostmessage {