diff --git a/public/locales/en-GB/app.json b/public/locales/en-GB/app.json index f4892717..47bdbdb5 100644 --- a/public/locales/en-GB/app.json +++ b/public/locales/en-GB/app.json @@ -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>{children}Connectivity to the server has been lost.", "<0><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><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?<1><0>Log in Or <2>Access as a guest": "<0>Already have an account?<1><0>Log in Or <2>Access as a guest", "<0>Create an account Or <2>Access as a guest": "<0>Create an account Or <2>Access as a guest", @@ -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", diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index 75c1bed3..1ffced8f 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -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 = ({ 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), diff --git a/src/DisconnectedBanner.tsx b/src/DisconnectedBanner.tsx index 84ecc432..9ba58700 100644 --- a/src/DisconnectedBanner.tsx +++ b/src/DisconnectedBanner.tsx @@ -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 && ( - -
- {children} - Connectivity to the server has been lost. -
-
+
+ {children} + {t("Connectivity to the server has been lost.")} +
)} );