Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K 2023-06-12 10:14:11 +02:00
parent d4d7518c40
commit 532dddcb2b
3 changed files with 10 additions and 14 deletions

View File

@ -10,7 +10,6 @@
"{{name}} is talking…": "{{name}} is talking…",
"{{names}}, {{name}}": "{{names}}, {{name}}",
"{{roomName}} - Walkie-talkie call": "{{roomName}} - Walkie-talkie call",
"<0>{children}Connectivity to the server has been lost.</0>": "<0>{children}Connectivity to the server has been lost.</0>",
"<0></0><1></1>You may withdraw consent by unchecking this box. If you are currently in a call, this setting will take effect at the end of the call.": "<0></0><1></1>You may withdraw consent by unchecking this box. If you are currently in a call, this setting will take effect at the end of the call.",
"<0>Already have an account?</0><1><0>Log in</0> Or <2>Access as a guest</2></1>": "<0>Already have an account?</0><1><0>Log in</0> Or <2>Access as a guest</2></1>",
"<0>Create an account</0> Or <2>Access as a guest</2>": "<0>Create an account</0> Or <2>Access as a guest</2>",
@ -37,6 +36,7 @@
"Close": "Close",
"Confirm password": "Confirm password",
"Connection lost": "Connection lost",
"Connectivity to the server has been lost.": "Connectivity to the server has been lost.",
"Copied!": "Copied!",
"Copy": "Copy",
"Copy and share this call link": "Copy and share this call link",

View File

@ -73,6 +73,7 @@ const saveSession = (session: Session) =>
const clearSession = () => localStorage.removeItem("matrix-auth-store");
const isDisconnected = (syncState, syncData) =>
syncState === "ERROR" && syncData?.error?.name === "ConnectionError";
interface ClientState {
loading: boolean;
isAuthenticated: boolean;
@ -123,8 +124,6 @@ export const ClientProvider: FC<Props> = ({ children }) => {
const onSync = (state: SyncState, _old: SyncState, data: ISyncStateData) => {
setState((currentState) => {
logger.log("syntData.name", data?.error?.name, "state:", state);
console.log("Current state:", currentState);
return {
...currentState,
disconnected: isDisconnected(state, data),

View File

@ -16,8 +16,7 @@ limitations under the License.
import classNames from "classnames";
import React, { HTMLAttributes, ReactNode } from "react";
import { logger } from "@sentry/utils";
import { Trans } from "react-i18next";
import { useTranslation } from "react-i18next";
import styles from "./DisconnectedBanner.module.css";
import { useClient } from "./ClientContext";
@ -32,18 +31,16 @@ export function DisconnectedBanner({
className,
...rest
}: DisconnectedBannerProps) {
const clientrp = useClient();
logger.log(clientrp);
const disconnected = clientrp.disconnected;
const { t } = useTranslation();
const { disconnected } = useClient();
return (
<>
{disconnected && (
<Trans>
<div className={classNames(styles.banner, className)} {...rest}>
{children}
Connectivity to the server has been lost.
</div>
</Trans>
<div className={classNames(styles.banner, className)} {...rest}>
{children}
{t("Connectivity to the server has been lost.")}
</div>
)}
</>
);