From 22bba15152eed7b2845240910b9c8c11e14284ba Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Sat, 13 Jan 2024 10:12:40 +0100 Subject: [PATCH] fix: Local versions are available not downloaded --- src/renderer/components/settings-electron.tsx | 6 +++--- src/renderer/components/version-select.tsx | 2 +- .../__snapshots__/settings-electron-spec.tsx.snap | 6 +++--- .../components/__snapshots__/version-select-spec.tsx.snap | 2 +- tests/renderer/components/version-select-spec.tsx | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/renderer/components/settings-electron.tsx b/src/renderer/components/settings-electron.tsx index 52eae7598e..2863630e25 100644 --- a/src/renderer/components/settings-electron.tsx +++ b/src/renderer/components/settings-electron.tsx @@ -222,7 +222,7 @@ export const ElectronSettings = observer( @@ -338,7 +338,7 @@ export const ElectronSettings = observer( const { state, source } = item; const isLocal = source === VersionSource.local; let icon: IconName = 'box'; - let humanState = 'Downloaded'; + let humanState = isLocal ? 'Available' : 'Downloaded'; if (state === InstallState.downloading) { icon = 'cloud-download'; @@ -347,7 +347,7 @@ export const ElectronSettings = observer( // The only way for a local version to be missing // is for it to have been deleted. Mark as unavailable. icon = isLocal ? 'issue' : 'cloud'; - humanState = isLocal ? 'Not available' : 'Not downloaded'; + humanState = isLocal ? 'Not Available' : 'Not Downloaded'; } return ( diff --git a/src/renderer/components/version-select.tsx b/src/renderer/components/version-select.tsx index dc16751add..752e3355db 100644 --- a/src/renderer/components/version-select.tsx +++ b/src/renderer/components/version-select.tsx @@ -71,7 +71,7 @@ export function getItemLabel({ source, state, name }: RunnableVersion): string { } const installStateLabels: Record = { - missing: 'Not downloaded', + missing: 'Not Downloaded', downloading: 'Downloading', downloaded: 'Downloaded', installing: 'Downloaded', diff --git a/tests/renderer/components/__snapshots__/settings-electron-spec.tsx.snap b/tests/renderer/components/__snapshots__/settings-electron-spec.tsx.snap index a7db626c8d..b95fe7d6b3 100644 --- a/tests/renderer/components/__snapshots__/settings-electron-spec.tsx.snap +++ b/tests/renderer/components/__snapshots__/settings-electron-spec.tsx.snap @@ -98,7 +98,7 @@ exports[`ElectronSettings component renders 1`] = ` @@ -190,7 +190,7 @@ exports[`ElectronSettings component renders 1`] = ` icon="box" /> - Downloaded + Available - Not downloaded + Not Downloaded { state: missing, }; - expect(getItemLabel(input)).toBe('Not downloaded'); + expect(getItemLabel(input)).toBe('Not Downloaded'); }); it('returns the correct label for a version downloaded', () => {