Skip to content

Commit

Permalink
fix: Local versions are available not downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jan 13, 2024
1 parent 54d9012 commit 22bba15
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/renderer/components/settings-electron.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const ElectronSettings = observer(
<Checkbox
checked={appState.showUndownloadedVersions}
id="showUndownloadedVersions"
label="Not downloaded"
label="Not Downloaded"
onChange={this.handleStateChange}
/>
</FormGroup>
Expand Down Expand Up @@ -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';
Expand All @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/version-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function getItemLabel({ source, state, name }: RunnableVersion): string {
}

const installStateLabels: Record<InstallState, string> = {
missing: 'Not downloaded',
missing: 'Not Downloaded',
downloading: 'Downloading',
downloaded: 'Downloaded',
installing: 'Downloaded',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports[`ElectronSettings component renders 1`] = `
<Blueprint3.Checkbox
checked={false}
id="showUndownloadedVersions"
label="Not downloaded"
label="Not Downloaded"
onChange={[Function]}
/>
</Blueprint3.FormGroup>
Expand Down Expand Up @@ -190,7 +190,7 @@ exports[`ElectronSettings component renders 1`] = `
icon="box"
/>
Downloaded
Available
</span>
</td>
<td
Expand Down Expand Up @@ -275,7 +275,7 @@ exports[`ElectronSettings component renders 1`] = `
icon="cloud"
/>
Not downloaded
Not Downloaded
</span>
</td>
<td
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`VersionSelect component renderItem() renders an item 1`] = `
active={true}
disabled={false}
icon="cloud"
label="Not downloaded"
label="Not Downloaded"
multiline={false}
onClick={[Function]}
popoverProps={{}}
Expand Down
2 changes: 1 addition & 1 deletion tests/renderer/components/version-select-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('VersionSelect component', () => {
state: missing,
};

expect(getItemLabel(input)).toBe('Not downloaded');
expect(getItemLabel(input)).toBe('Not Downloaded');
});

it('returns the correct label for a version downloaded', () => {
Expand Down

0 comments on commit 22bba15

Please sign in to comment.