Skip to content

Commit

Permalink
fix: placeholder no hardware detect
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Oct 23, 2024
1 parent 0c78aad commit a79190c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions web/screens/Settings/Advanced/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ const Advanced = () => {
saveSettings({ gpusInUse: updatedGpusInUse })
}

const gpuSelectionPlaceHolder =
gpuList.length > 0 ? 'Select GPU' : "You don't have any compatible GPU"

/**
* Handle click outside
*/
Expand Down Expand Up @@ -322,13 +325,20 @@ const Advanced = () => {
<div className="relative w-full md:w-1/2" ref={setToggle}>
<Input
value={selectedGpu.join() || ''}
className="w-full cursor-pointer"
className={twMerge(
'w-full cursor-pointer',
gpuList.length === 0 && 'pointer-events-none'
)}
readOnly
placeholder=""
disabled={gpuList.length === 0}
placeholder={gpuSelectionPlaceHolder}
suffixIcon={
<ChevronDownIcon
size={14}
className={twMerge(open && 'rotate-180')}
className={twMerge(
gpuList.length === 0 && 'pointer-events-none',
open && 'rotate-180'
)}
/>
}
onClick={() => setOpen(!open)}
Expand Down

0 comments on commit a79190c

Please sign in to comment.