@@ -20,7 +20,6 @@ import { logger } from "matrix-js-sdk/src/logger";
2020
2121import AccessibleButton from "../elements/AccessibleButton" ;
2222import Modal from "../../../Modal" ;
23- import PersistedElement from "../elements/PersistedElement" ;
2423import QuestionDialog from './QuestionDialog' ;
2524import SdkConfig from "../../../SdkConfig" ;
2625import { _t } from "../../../languageHandler" ;
@@ -35,8 +34,6 @@ import {
3534import { IConfigOptions } from "../../../IConfigOptions" ;
3635import { SnakedObject } from "../../../utils/SnakedObject" ;
3736
38- const HOST_SIGNUP_KEY = "host_signup" ;
39-
4037interface IProps { }
4138
4239interface IState {
@@ -111,8 +108,6 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
111108
112109 private closeDialog = async ( ) => {
113110 window . removeEventListener ( "message" , this . messageHandler ) ;
114- // Ensure we destroy the host signup persisted element
115- PersistedElement . destroyElement ( "host_signup" ) ;
116111 // Finally clear the flag in
117112 return HostSignupStore . instance . setHostSignupActive ( false ) ;
118113 } ;
@@ -235,69 +230,65 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
235230
236231 public render ( ) : React . ReactNode {
237232 return (
238- < div className = "mx_HostSignup_persisted" >
239- < PersistedElement key = { HOST_SIGNUP_KEY } persistKey = { HOST_SIGNUP_KEY } >
240- < div className = { classNames ( { "mx_Dialog_wrapper" : ! this . state . minimized } ) } >
241- < div
242- className = { classNames ( "mx_Dialog" ,
233+ < div className = { classNames ( { "mx_Dialog_wrapper" : ! this . state . minimized } ) } >
234+ < div
235+ className = { classNames ( "mx_Dialog" ,
236+ {
237+ "mx_HostSignupDialog_minimized" : this . state . minimized ,
238+ "mx_HostSignupDialog" : ! this . state . minimized ,
239+ } ,
240+ ) }
241+ >
242+ { this . state . minimized &&
243+ < div className = "mx_Dialog_header mx_Dialog_headerWithButton" >
244+ < div className = "mx_Dialog_title" >
245+ { _t ( "%(hostSignupBrand)s Setup" , {
246+ hostSignupBrand : this . config . get ( "brand" ) ,
247+ } ) }
248+ </ div >
249+ < AccessibleButton
250+ className = "mx_HostSignup_maximize_button"
251+ onClick = { this . maximizeDialog }
252+ aria-label = { _t ( "Maximise dialog" ) }
253+ title = { _t ( "Maximise dialog" ) }
254+ />
255+ </ div >
256+ }
257+ { ! this . state . minimized &&
258+ < div className = "mx_Dialog_header mx_Dialog_headerWithCancel" >
259+ < AccessibleButton
260+ onClick = { this . minimizeDialog }
261+ className = "mx_HostSignup_minimize_button"
262+ aria-label = { _t ( "Minimise dialog" ) }
263+ title = { _t ( "Minimise dialog" ) }
264+ />
265+ < AccessibleButton
266+ onClick = { this . onCloseClick }
267+ className = "mx_Dialog_cancelButton"
268+ aria-label = { _t ( "Close dialog" ) }
269+ title = { _t ( "Close dialog" ) }
270+ />
271+ </ div >
272+ }
273+ { this . state . error &&
274+ < div >
275+ { this . state . error }
276+ </ div >
277+ }
278+ { ! this . state . error &&
279+ < iframe
280+ title = { _t (
281+ "Upgrade to %(hostSignupBrand)s" ,
243282 {
244- "mx_HostSignupDialog_minimized" : this . state . minimized ,
245- "mx_HostSignupDialog" : ! this . state . minimized ,
283+ hostSignupBrand : this . config . get ( "brand" ) ,
246284 } ,
247285 ) }
248- >
249- { this . state . minimized &&
250- < div className = "mx_Dialog_header mx_Dialog_headerWithButton" >
251- < div className = "mx_Dialog_title" >
252- { _t ( "%(hostSignupBrand)s Setup" , {
253- hostSignupBrand : this . config . get ( "brand" ) ,
254- } ) }
255- </ div >
256- < AccessibleButton
257- className = "mx_HostSignup_maximize_button"
258- onClick = { this . maximizeDialog }
259- aria-label = { _t ( "Maximise dialog" ) }
260- title = { _t ( "Maximise dialog" ) }
261- />
262- </ div >
263- }
264- { ! this . state . minimized &&
265- < div className = "mx_Dialog_header mx_Dialog_headerWithCancel" >
266- < AccessibleButton
267- onClick = { this . minimizeDialog }
268- className = "mx_HostSignup_minimize_button"
269- aria-label = { _t ( "Minimise dialog" ) }
270- title = { _t ( "Minimise dialog" ) }
271- />
272- < AccessibleButton
273- onClick = { this . onCloseClick }
274- className = "mx_Dialog_cancelButton"
275- aria-label = { _t ( "Close dialog" ) }
276- title = { _t ( "Close dialog" ) }
277- />
278- </ div >
279- }
280- { this . state . error &&
281- < div >
282- { this . state . error }
283- </ div >
284- }
285- { ! this . state . error &&
286- < iframe
287- title = { _t (
288- "Upgrade to %(hostSignupBrand)s" ,
289- {
290- hostSignupBrand : this . config . get ( "brand" ) ,
291- } ,
292- ) }
293- src = { this . config . get ( "url" ) }
294- ref = { this . iframeRef }
295- sandbox = "allow-forms allow-scripts allow-same-origin allow-popups"
296- />
297- }
298- </ div >
299- </ div >
300- </ PersistedElement >
286+ src = { this . config . get ( "url" ) }
287+ ref = { this . iframeRef }
288+ sandbox = "allow-forms allow-scripts allow-same-origin allow-popups"
289+ />
290+ }
291+ </ div >
301292 </ div >
302293 ) ;
303294 }
0 commit comments