diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index b69d0b28..7f809a4e 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -351,5 +351,7 @@ "Created at: {{time}}": "Created at: {{time}}", "Edited by {{name}} {{time}}": "Edited by {{name}} {{time}}", "Word count: {{wordCount}}": "Word count: {{wordCount}}", - "Character count: {{characterCount}}": "Character count: {{characterCount}}" + "Character count: {{characterCount}}": "Character count: {{characterCount}}", + "New update": "New update", + "{{latestVersion}} is available": "{{latestVersion}} is available" } diff --git a/apps/client/src/components/settings/app-version.tsx b/apps/client/src/components/settings/app-version.tsx index ac3e8eed..f5097d51 100644 --- a/apps/client/src/components/settings/app-version.tsx +++ b/apps/client/src/components/settings/app-version.tsx @@ -4,23 +4,31 @@ import classes from "@/components/settings/settings.module.css"; import { Indicator, Text, Tooltip } from "@mantine/core"; import React from "react"; import semverGt from "semver/functions/gt"; +import { useTranslation } from "react-i18next"; export default function AppVersion() { + const { t } = useTranslation(); const { data: appVersion } = useAppVersion(!isCloud()); - - const hasUpdate = - appVersion && - parseFloat(appVersion.latestVersion) > 0 && - semverGt(appVersion.latestVersion, appVersion.currentVersion); + let hasUpdate = false; + try { + hasUpdate = + appVersion && + parseFloat(appVersion.latestVersion) > 0 && + semverGt(appVersion.latestVersion, appVersion.currentVersion); + } catch (err) { + console.error(err); + } return (