mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Don't guess the server name from the URL
It only uses the default HS URL anywayso just use the default server name.
This commit is contained in:
parent
d6b8ecdfd1
commit
fd3c0d9fc6
@ -14,14 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {
|
import React, { FC, FormEvent, useCallback, useRef, useState } from "react";
|
||||||
FC,
|
|
||||||
FormEvent,
|
|
||||||
useCallback,
|
|
||||||
useRef,
|
|
||||||
useState,
|
|
||||||
useMemo,
|
|
||||||
} from "react";
|
|
||||||
import { useHistory, useLocation, Link } from "react-router-dom";
|
import { useHistory, useLocation, Link } from "react-router-dom";
|
||||||
import { Trans, useTranslation } from "react-i18next";
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
|
|
||||||
@ -75,12 +68,6 @@ export const LoginPage: FC = () => {
|
|||||||
[login, location, history, homeserver, setClient]
|
[login, location, history, homeserver, setClient]
|
||||||
);
|
);
|
||||||
|
|
||||||
const homeserverHost = useMemo(() => {
|
|
||||||
// XXX: This isn't really correct: the server name of an HS may not
|
|
||||||
// be the same as the hostname of the client API endpoint.
|
|
||||||
return new URL(homeserver).host;
|
|
||||||
}, [homeserver]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
@ -100,7 +87,7 @@ export const LoginPage: FC = () => {
|
|||||||
autoCorrect="off"
|
autoCorrect="off"
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
prefix="@"
|
prefix="@"
|
||||||
suffix={`:${homeserverHost}`}
|
suffix={`:${Config.defaultServerName()}`}
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
<FieldRow>
|
<FieldRow>
|
||||||
|
Loading…
Reference in New Issue
Block a user