Remove unintentional changes

pull/21833/head
David Baker 2020-04-01 11:41:32 +01:00
parent 293c8f0e7c
commit 2cc938a576
1 changed files with 3 additions and 6 deletions

View File

@ -22,7 +22,6 @@ import {makeType} from "./TypeUtils";
import SdkConfig from '../SdkConfig'; import SdkConfig from '../SdkConfig';
const LIVELINESS_DISCOVERY_ERRORS = [ const LIVELINESS_DISCOVERY_ERRORS = [
AutoDiscovery.ERROR_INVALID,
AutoDiscovery.ERROR_INVALID_HOMESERVER, AutoDiscovery.ERROR_INVALID_HOMESERVER,
AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER, AutoDiscovery.ERROR_INVALID_IDENTITY_SERVER,
]; ];
@ -233,8 +232,8 @@ export default class AutoDiscoveryUtils {
const preferredHomeserverUrl = hsResult["base_url"]; const preferredHomeserverUrl = hsResult["base_url"];
let preferredHomeserverName = serverName ? serverName : hsResult["server_name"]; let preferredHomeserverName = serverName ? serverName : hsResult["server_name"];
const url = preferredHomeserverUrl ? new URL(preferredHomeserverUrl) : null; const url = new URL(preferredHomeserverUrl);
if (!preferredHomeserverName && url) preferredHomeserverName = url.hostname; if (!preferredHomeserverName) preferredHomeserverName = url.hostname;
// It should have been set by now, so check it // It should have been set by now, so check it
if (!preferredHomeserverName) { if (!preferredHomeserverName) {
@ -242,12 +241,10 @@ export default class AutoDiscoveryUtils {
throw newTranslatableError(_td("Unexpected error resolving homeserver configuration")); throw newTranslatableError(_td("Unexpected error resolving homeserver configuration"));
} }
const hsNameIsDifferent = url ? (url.hostname !== preferredHomeserverName) : null;
return makeType(ValidatedServerConfig, { return makeType(ValidatedServerConfig, {
hsUrl: preferredHomeserverUrl, hsUrl: preferredHomeserverUrl,
hsName: preferredHomeserverName, hsName: preferredHomeserverName,
hsNameIsDifferent, hsNameIsDifferent: url.hostname !== preferredHomeserverName,
isUrl: preferredIdentityUrl, isUrl: preferredIdentityUrl,
isDefault: false, isDefault: false,
warning: hsResult.error, warning: hsResult.error,