Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: local versions are available not downloaded #1528

Merged
merged 1 commit into from
Jan 15, 2024
Merged
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
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