From b0420c106eab05f8fe8a8615d2c3430d87f3a29c Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 14 Aug 2019 10:06:05 +0100 Subject: [PATCH] Prepopulate client default on disconnect --- src/components/views/settings/SetIdServer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/SetIdServer.js b/src/components/views/settings/SetIdServer.js index 96382d9cb4..ad11b20967 100644 --- a/src/components/views/settings/SetIdServer.js +++ b/src/components/views/settings/SetIdServer.js @@ -174,11 +174,19 @@ export default class SetIdServer extends React.Component { MatrixClientPeg.get().setIdentityServerUrl(null); localStorage.removeItem("mx_is_access_token"); localStorage.removeItem("mx_is_url"); + + let newFieldVal = ''; + if (SdkConfig.get()['validated_server_config']['isUrl']) { + // Prepopulate the client's default so the user at least has some idea of + // a valid value they might enter + newFieldVal = abbreviateUrl(SdkConfig.get()['validated_server_config']['isUrl']); + } + this.setState({ busy: false, error: null, currentClientIdServer: MatrixClientPeg.get().getIdentityServerUrl(), - idServer: '', + idServer: newFieldVal, }); };