Ensure elements on Login page are disabled when in-flight (#12895)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
3f386a6cac
commit
9f5b39b9d9
3 changed files with 16 additions and 3 deletions
|
@ -485,6 +485,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
|
||||||
fragmentAfterLogin={this.props.fragmentAfterLogin}
|
fragmentAfterLogin={this.props.fragmentAfterLogin}
|
||||||
primary={!this.state.flows?.find((flow) => flow.type === "m.login.password")}
|
primary={!this.state.flows?.find((flow) => flow.type === "m.login.password")}
|
||||||
action={SSOAction.LOGIN}
|
action={SSOAction.LOGIN}
|
||||||
|
disabled={this.isBusy()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -558,6 +559,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
|
||||||
<ServerPicker
|
<ServerPicker
|
||||||
serverConfig={this.props.serverConfig}
|
serverConfig={this.props.serverConfig}
|
||||||
onServerConfigChange={this.props.onServerConfigChange}
|
onServerConfigChange={this.props.onServerConfigChange}
|
||||||
|
disabled={this.isBusy()}
|
||||||
/>
|
/>
|
||||||
{this.renderLoginComponentForFlows()}
|
{this.renderLoginComponentForFlows()}
|
||||||
{footer}
|
{footer}
|
||||||
|
|
|
@ -151,11 +151,20 @@ interface IProps {
|
||||||
fragmentAfterLogin?: string;
|
fragmentAfterLogin?: string;
|
||||||
primary?: boolean;
|
primary?: boolean;
|
||||||
action?: SSOAction;
|
action?: SSOAction;
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_PER_ROW = 6;
|
const MAX_PER_ROW = 6;
|
||||||
|
|
||||||
const SSOButtons: React.FC<IProps> = ({ matrixClient, flow, loginType, fragmentAfterLogin, primary, action }) => {
|
const SSOButtons: React.FC<IProps> = ({
|
||||||
|
matrixClient,
|
||||||
|
flow,
|
||||||
|
loginType,
|
||||||
|
fragmentAfterLogin,
|
||||||
|
primary,
|
||||||
|
action,
|
||||||
|
disabled,
|
||||||
|
}) => {
|
||||||
const providers = flow.identity_providers || [];
|
const providers = flow.identity_providers || [];
|
||||||
if (providers.length < 2) {
|
if (providers.length < 2) {
|
||||||
return (
|
return (
|
||||||
|
@ -168,6 +177,7 @@ const SSOButtons: React.FC<IProps> = ({ matrixClient, flow, loginType, fragmentA
|
||||||
primary={primary}
|
primary={primary}
|
||||||
action={action}
|
action={action}
|
||||||
flow={flow}
|
flow={flow}
|
||||||
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -29,6 +29,7 @@ interface IProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
dialogTitle?: string;
|
dialogTitle?: string;
|
||||||
serverConfig: ValidatedServerConfig;
|
serverConfig: ValidatedServerConfig;
|
||||||
|
disabled?: boolean;
|
||||||
onServerConfigChange?(config: ValidatedServerConfig): void;
|
onServerConfigChange?(config: ValidatedServerConfig): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ const onHelpClick = (): void => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ServerPicker: React.FC<IProps> = ({ title, dialogTitle, serverConfig, onServerConfigChange }) => {
|
const ServerPicker: React.FC<IProps> = ({ title, dialogTitle, serverConfig, onServerConfigChange, disabled }) => {
|
||||||
const disableCustomUrls = SdkConfig.get("disable_custom_urls");
|
const disableCustomUrls = SdkConfig.get("disable_custom_urls");
|
||||||
|
|
||||||
let editBtn;
|
let editBtn;
|
||||||
|
@ -68,7 +69,7 @@ const ServerPicker: React.FC<IProps> = ({ title, dialogTitle, serverConfig, onSe
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
editBtn = (
|
editBtn = (
|
||||||
<AccessibleButton className="mx_ServerPicker_change" kind="link" onClick={onClick}>
|
<AccessibleButton className="mx_ServerPicker_change" kind="link" onClick={onClick} disabled={disabled}>
|
||||||
{_t("action|edit")}
|
{_t("action|edit")}
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue