Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<VersionTab appInfo={mockAppInfo} isLoading={false} error={null} />
)

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'

Expand Down
5 changes: 3 additions & 2 deletions renderer/src/common/components/settings/tabs/version-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)

Expand Down Expand Up @@ -144,7 +145,7 @@ export function VersionTab({ appInfo, isLoading, error }: VersionTabProps) {
<Separator />
</div>

{canShowAutoUpdate && (
{canShowAutoUpdateControls && (
<>
<SettingsSectionTitle>Updates</SettingsSectionTitle>
<div className="flex flex-col gap-3 py-1">
Expand Down