Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 0d1020c

Browse files
authored
Fix start_sso not working with guests disabled (#10720)
* Fix start_sso not working with guests disabled * Remove confusing prop
1 parent 4c72cce commit 0d1020c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/components/structures/MatrixChat.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ interface IScreen {
161161

162162
interface IProps {
163163
config: IConfigOptions;
164-
serverConfig?: ValidatedServerConfig;
165164
onNewScreen: (screen: string, replaceLast: boolean) => void;
166165
enableGuest?: boolean;
167166
// the queryParams extracted from the [real] query-string of the URI
@@ -474,15 +473,13 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
474473
}, 1000);
475474

476475
private getFallbackHsUrl(): string | undefined {
477-
if (this.props.serverConfig?.isDefault) {
476+
if (this.getServerProperties().serverConfig?.isDefault) {
478477
return this.props.config.fallback_hs_url;
479478
}
480479
}
481480

482481
private getServerProperties(): { serverConfig: ValidatedServerConfig } {
483-
let props = this.state.serverConfig;
484-
if (!props) props = this.props.serverConfig; // for unit tests
485-
if (!props) props = SdkConfig.get("validated_server_config")!;
482+
const props = this.state.serverConfig || SdkConfig.get("validated_server_config")!;
486483
return { serverConfig: props };
487484
}
488485

@@ -1776,7 +1773,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
17761773
} else if (screen === "start_sso" || screen === "start_cas") {
17771774
let cli = MatrixClientPeg.get();
17781775
if (!cli) {
1779-
const { hsUrl, isUrl } = this.props.serverConfig;
1776+
const { hsUrl, isUrl } = this.getServerProperties().serverConfig;
17801777
cli = createClient({
17811778
baseUrl: hsUrl,
17821779
idBaseUrl: isUrl,

0 commit comments

Comments
 (0)