diff --git a/renderer/src/common/components/settings/tabs/__tests__/version-tab.test.tsx b/renderer/src/common/components/settings/tabs/__tests__/version-tab.test.tsx index 9b236cc1b..a886b166f 100644 --- a/renderer/src/common/components/settings/tabs/__tests__/version-tab.test.tsx +++ b/renderer/src/common/components/settings/tabs/__tests__/version-tab.test.tsx @@ -354,6 +354,19 @@ describe('VersionTab', () => { expect(screen.queryByText('Updates')).not.toBeInTheDocument() }) + it('hides the auto-update controls on Linux', () => { + window.electronAPI.isLinux = true + + renderWithProviders( + + ) + + expect(screen.queryByText('Updates')).not.toBeInTheDocument() + expect( + screen.queryByRole('switch', { name: /downloads/i }) + ).not.toBeInTheDocument() + }) + it('hides the update-available banner when auto-update permission is false', () => { import.meta.env.MODE = 'production' diff --git a/renderer/src/common/components/settings/tabs/version-tab.tsx b/renderer/src/common/components/settings/tabs/version-tab.tsx index 2245831d1..e671bc697 100644 --- a/renderer/src/common/components/settings/tabs/version-tab.tsx +++ b/renderer/src/common/components/settings/tabs/version-tab.tsx @@ -55,7 +55,9 @@ export function VersionTab({ appInfo, isLoading, error }: VersionTabProps) { useAutoUpdateStatus() const { mutateAsync: setAutoUpdate, isPending: isSetAutoUpdatePending } = useSetAutoUpdate() + const isLinux = window.electronAPI?.isLinux const canShowAutoUpdate = canShow(PERMISSION_KEYS.AUTO_UPDATE) + const canShowAutoUpdateControls = canShowAutoUpdate && !isLinux const canShowUpdateAlert = canShowAutoUpdate && appInfo?.isNewVersionAvailable && isProduction @@ -82,7 +84,6 @@ export function VersionTab({ appInfo, isLoading, error }: VersionTabProps) { } const handleManualUpdate = () => { - const isLinux = window.electronAPI?.isLinux if (isLinux) { window.open(GITHUB_RELEASES_URL) @@ -144,7 +145,7 @@ export function VersionTab({ appInfo, isLoading, error }: VersionTabProps) { - {canShowAutoUpdate && ( + {canShowAutoUpdateControls && ( <> Updates