WIP minimize

This commit is contained in:
Jason Robinson 2021-01-14 12:20:42 +02:00
parent d4a58bdb2a
commit d6af5b3bbd
5 changed files with 60 additions and 22 deletions

View file

@ -21,6 +21,7 @@ import QuestionDialog from './QuestionDialog';
import SdkConfig from "../../../SdkConfig";
import {_t} from "../../../languageHandler";
import {MatrixClientPeg} from "../../../MatrixClientPeg";
import {HostSignupStore} from "../../../stores/HostSignupStore";
import {OwnProfileStore} from "../../../stores/OwnProfileStore";
import {IPostmessage, IPostmessageResponseData, PostmessageAction} from "./HostSignupDialogTypes";
@ -72,8 +73,7 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
});
break;
case PostmessageAction.CloseDialog:
this.onFinished(true);
break;
return this.onFinished(true);
}
}
@ -94,10 +94,10 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
// Ensure we destroy the host signup persisted element
PersistedElement.destroyElement("host_signup");
// Finally clear the flag in
return OwnProfileStore.instance.setHostSignupActive(false);
return HostSignupStore.instance.setHostSignupActive(false);
}
private onFinished = (result: boolean) => {
private onFinished = async (result: boolean) => {
if (result || this.state.completed) {
// We're done, close
return this.closeDialog();
@ -153,7 +153,7 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
}
public componentWillUnmount() {
if (OwnProfileStore.instance.isHostSignupActive) {
if (HostSignupStore.instance.isHostSignupActive) {
// Run the close dialog actions if we're still active, otherwise good to go
return this.closeDialog();
}