Skip to content

Commit

Permalink
fix: item label and icon for missing local
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jan 12, 2024
1 parent 54d9012 commit 42630d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/renderer/components/version-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ const itemListRenderer: ItemListRenderer<RunnableVersion> = ({
* @returns {string}
*/
export function getItemLabel({ source, state, name }: RunnableVersion): string {
// If a version is local, either it's there or it's not.
if (source === VersionSource.local) {
return name || 'Local';
return state === 'missing' ? 'Unavailable' : name || 'Local';
}

const installStateLabels: Record<InstallState, string> = {
Expand All @@ -87,7 +88,12 @@ export function getItemLabel({ source, state, name }: RunnableVersion): string {
* @param {RunnableVersion} { state }
* @returns {IconName}
*/
export function getItemIcon({ state }: RunnableVersion): IconName {
export function getItemIcon({ source, state }: RunnableVersion): IconName {
// If a version is local, either it's there or it's not.
if (source === VersionSource.local) {
return state === InstallState.missing ? 'disable' : 'saved';
}

const installStateIcons: Record<InstallState, IconName> = {
missing: 'cloud',
downloading: 'cloud-download',
Expand Down

0 comments on commit 42630d5

Please sign in to comment.