diff --git a/apps/settings/src/components/AuthToken.spec.ts b/apps/settings/src/components/AuthToken.spec.ts index ad561894ec8c6..75b483247f66f 100644 --- a/apps/settings/src/components/AuthToken.spec.ts +++ b/apps/settings/src/components/AuthToken.spec.ts @@ -3,19 +3,19 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +import type { IToken } from '../store/authtoken.ts' + import { createTestingPinia } from '@pinia/testing' import { mount } from '@vue/test-utils' import { beforeEach, describe, expect, it, vi } from 'vitest' -// AuthToken.vue reads window.oc_defaults at module evaluation time. vi.hoisted -// runs before imports, so this guarantees the property is set on the existing -// jsdom window before the SFC is first parsed. +// AuthToken.vue reads window.OC.theme.productName at module evaluation time. +// vi.hoisted runs before imports, so this guarantees the property is set on +// the existing jsdom window before the SFC is first parsed. vi.hoisted(() => { - (window as unknown as { oc_defaults: { productName: string } }).oc_defaults = { productName: 'Nextcloud' } + (window as unknown as { OC: { theme: { productName: string } } }).OC.theme = { productName: 'Nextcloud' } }) -import type { IToken } from '../store/authtoken.ts' - // Mock @nextcloud/dialogs so the wipe action's showConfirmation call resolves // synchronously in tests. Hoisted so it's installed before AuthToken.vue imports. const showConfirmationMock = vi.hoisted(() => vi.fn()) diff --git a/apps/settings/src/components/AuthToken.vue b/apps/settings/src/components/AuthToken.vue index 59f733f59c1f8..716ed27edb0a4 100644 --- a/apps/settings/src/components/AuthToken.vue +++ b/apps/settings/src/components/AuthToken.vue @@ -109,6 +109,8 @@ import AuthTokenDeleteDialog from './AuthTokenDeleteDialog.vue' import { TokenType, useAuthTokenStore } from '../store/authtoken.ts' import { detect } from '../utils/userAgentDetect.ts' +const productName = window.OC.theme.productName as string + const nameMap = { edge: 'Microsoft Edge', firefox: 'Firefox', @@ -117,10 +119,10 @@ const nameMap = { androidChrome: t('settings', 'Google Chrome for Android'), iphone: 'iPhone', ipad: 'iPad', - iosClient: t('settings', '{productName} iOS app', { productName: window.oc_defaults.productName }), - androidClient: t('settings', '{productName} Android app', { productName: window.oc_defaults.productName }), - iosTalkClient: t('settings', '{productName} Talk for iOS', { productName: window.oc_defaults.productName }), - androidTalkClient: t('settings', '{productName} Talk for Android', { productName: window.oc_defaults.productName }), + iosClient: t('settings', '{productName} iOS app', { productName }), + androidClient: t('settings', '{productName} Android app', { productName }), + iosTalkClient: t('settings', '{productName} Talk for iOS', { productName }), + androidTalkClient: t('settings', '{productName} Talk for Android', { productName }), syncClient: t('settings', 'Sync client'), davx5: 'DAVx5', webPirate: 'WebPirate', diff --git a/apps/settings/src/components/AuthTokenSection.vue b/apps/settings/src/components/AuthTokenSection.vue index e53f5ea11525c..87bd66fb3ddd3 100644 --- a/apps/settings/src/components/AuthTokenSection.vue +++ b/apps/settings/src/components/AuthTokenSection.vue @@ -4,20 +4,19 @@ --> - - {{ t('settings', 'Devices & sessions', {}, undefined, { sanitize: false }) }} - - {{ t('settings', 'Web, desktop and mobile clients currently logged in to your account.') }} - + - +
- {{ t('settings', 'Web, desktop and mobile clients currently logged in to your account.') }} -