diff --git a/ui/src/i18n/lib/translate.ts b/ui/src/i18n/lib/translate.ts index badd868956e..d092ccb62c8 100644 --- a/ui/src/i18n/lib/translate.ts +++ b/ui/src/i18n/lib/translate.ts @@ -33,7 +33,9 @@ class I18nManager { } public async setLocale(locale: Locale) { - if (this.locale === locale) return; + if (this.locale === locale) { + return; + } // Lazy load translations if needed if (!this.translations[locale]) { @@ -75,7 +77,7 @@ class I18nManager { public t(key: string, params?: Record): string { const keys = key.split("."); - let value: any = this.translations[this.locale] || this.translations["en"]; + let value: unknown = this.translations[this.locale] || this.translations["en"]; for (const k of keys) { if (value && typeof value === "object") { diff --git a/ui/src/i18n/test/translate.test.ts b/ui/src/i18n/test/translate.test.ts index 0a1916e434a..8d6f32ef2d6 100644 --- a/ui/src/i18n/test/translate.test.ts +++ b/ui/src/i18n/test/translate.test.ts @@ -1,4 +1,4 @@ -import { describe, it, expect, beforeEach, vi } from "vitest"; +import { describe, it, expect, beforeEach } from "vitest"; import { i18n, t } from "../lib/translate.ts"; describe("i18n", () => { diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index a05900c29c8..ef35489faca 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -1,7 +1,7 @@ import { html, nothing } from "lit"; import type { AppViewState } from "./app-view-state.ts"; import { parseAgentSessionKey } from "../../../src/routing/session-key.js"; -import { t, i18n, type Locale } from "../i18n/index.ts"; +import { t } from "../i18n/index.ts"; import { refreshChatAvatar } from "./app-chat.ts"; import { renderUsageTab } from "./app-render-usage-tab.ts"; import { renderChatControls, renderTab, renderThemeToggle } from "./app-render.helpers.ts"; diff --git a/ui/src/ui/views/overview.ts b/ui/src/ui/views/overview.ts index f21f4b4a3fc..e9c4c312ec6 100644 --- a/ui/src/ui/views/overview.ts +++ b/ui/src/ui/views/overview.ts @@ -33,10 +33,14 @@ export function renderOverview(props: OverviewProps) { : t("common.na"); const authHint = (() => { - if (props.connected || !props.lastError) return null; + if (props.connected || !props.lastError) { + return null; + } const lower = props.lastError.toLowerCase(); const authFailed = lower.includes("unauthorized") || lower.includes("connect failed"); - if (!authFailed) return null; + if (!authFailed) { + return null; + } const hasToken = Boolean(props.settings.token.trim()); const hasPassword = Boolean(props.password.trim()); if (!hasToken && !hasPassword) { @@ -78,9 +82,13 @@ export function renderOverview(props: OverviewProps) { })(); const insecureContextHint = (() => { - if (props.connected || !props.lastError) return null; + if (props.connected || !props.lastError) { + return null; + } const isSecureContext = typeof window !== "undefined" ? window.isSecureContext : true; - if (isSecureContext !== false) return null; + if (isSecureContext !== false) { + return null; + } const lower = props.lastError.toLowerCase(); if (!lower.includes("secure context") && !lower.includes("device identity required")) { return null;