From 10b19622db3f73c7b009418829283af5c0a6540d Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 12 Aug 2019 13:29:52 +0100 Subject: [PATCH] Don't clear field on failure --- src/components/views/settings/SetIdServer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/SetIdServer.js b/src/components/views/settings/SetIdServer.js index b86b255079..0140695838 100644 --- a/src/components/views/settings/SetIdServer.js +++ b/src/components/views/settings/SetIdServer.js @@ -131,15 +131,18 @@ export default class SetIdServer extends React.Component { const fullUrl = unabbreviateUrl(this.state.idServer); const errStr = await checkIsUrl(fullUrl); + + let newFormValue = this.state.idServer; if (!errStr) { MatrixClientPeg.get().setIdentityServerUrl(fullUrl); localStorage.setItem("mx_is_url", fullUrl); + newFormValue = ''; } this.setState({ busy: false, error: errStr, currentClientIdServer: MatrixClientPeg.get().getIdentityServerUrl(), - idServer: '', + idServer: newFormValue, }); };