From 072d9f12c73af40fa129569050d6b5ffb028fab3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 1 Apr 2020 11:41:32 +0100 Subject: [PATCH] Remove unintentional changes --- src/utils/AutoDiscoveryUtils.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/utils/AutoDiscoveryUtils.js b/src/utils/AutoDiscoveryUtils.js index 5114fa278f..328aa9c776 100644 --- a/src/utils/AutoDiscoveryUtils.js +++ b/src/utils/AutoDiscoveryUtils.js @@ -22,7 +22,6 @@ import {makeType} from "./TypeUtils"; import SdkConfig from '../SdkConfig'; const LIVELINESS_DISCOVERY_ERRORS = [ - AutoDiscovery.ERROR_INVALID, AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, ]; @@ -233,8 +232,8 @@ export default class AutoDiscoveryUtils { const preferredHomeserverUrl = hsResult["base_url"]; let preferredHomeserverName = serverName ? serverName : hsResult["server_name"]; - const url = preferredHomeserverUrl ? new URL(preferredHomeserverUrl) : null; - if (!preferredHomeserverName && url) preferredHomeserverName = url.hostname; + const url = new URL(preferredHomeserverUrl); + if (!preferredHomeserverName) preferredHomeserverName = url.hostname; // It should have been set by now, so check it if (!preferredHomeserverName) { @@ -242,12 +241,10 @@ export default class AutoDiscoveryUtils { throw newTranslatableError(_td("Unexpected error resolving homeserver configuration")); } - const hsNameIsDifferent = url ? (url.hostname !== preferredHomeserverName) : null; - return makeType(ValidatedServerConfig, { hsUrl: preferredHomeserverUrl, hsName: preferredHomeserverName, - hsNameIsDifferent, + hsNameIsDifferent: url.hostname !== preferredHomeserverName, isUrl: preferredIdentityUrl, isDefault: false, warning: hsResult.error,