Skip to content

Commit

Permalink
fix: hostd walletd hide gpu preference
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Nov 15, 2023
1 parent b72ef30 commit 5308806
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .changeset/quick-forks-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'hostd': minor
'walletd': minor
---

App preferences no longer list unused GPU setting.
1 change: 1 addition & 0 deletions apps/renterd/contexts/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export function Dialogs() {
<SettingsDialog
open={dialog === 'settings'}
onOpenChange={onOpenChange}
showGpuSetting
/>
<RenterdSendSiacoinDialog />
<WalletSingleAddressDetailsDialog
Expand Down
56 changes: 32 additions & 24 deletions libs/design-system/src/app/SettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ type Props = {
open: boolean
onOpenChange: (open: boolean) => void
securityEl?: React.ReactNode
showGpuSetting?: boolean
}

export function SettingsDialog({ open, onOpenChange, securityEl }: Props) {
export function SettingsDialog({
open,
onOpenChange,
securityEl,
showGpuSetting,
}: Props) {
const { settings, setSettings, gpu } = useAppSettings()

return (
Expand Down Expand Up @@ -96,30 +102,32 @@ export function SettingsDialog({ open, onOpenChange, securityEl }: Props) {
</Paragraph>
</div>
</Alert>
<Alert>
<div className="flex flex-col gap-4">
<div className="flex gap-2 items-center">
<Text>
<Information16 />
</Text>
<Heading size="20" className="flex-1">
GPU
</Heading>
<Switch
disabled={!gpu.canGpuRender}
checked={gpu.canGpuRender && gpu.isGpuEnabled}
onCheckedChange={gpu.setIsGpuEnabled}
size="medium"
/>
{showGpuSetting && (
<Alert>
<div className="flex flex-col gap-4">
<div className="flex gap-2 items-center">
<Text>
<Information16 />
</Text>
<Heading size="20" className="flex-1">
GPU
</Heading>
<Switch
disabled={!gpu.canGpuRender}
checked={gpu.canGpuRender && gpu.isGpuEnabled}
onCheckedChange={gpu.setIsGpuEnabled}
size="medium"
/>
</div>
<Paragraph size="14">
Enable features that require a GPU.{' '}
{gpu.canGpuRender
? ''
: 'This device does not support GPU rendering.'}
</Paragraph>
</div>
<Paragraph size="14">
Enable features that require a GPU.{' '}
{gpu.canGpuRender
? ''
: 'This device does not support GPU rendering.'}
</Paragraph>
</div>
</Alert>
</Alert>
)}
</div>
</div>
<Separator className="w-full" />
Expand Down

0 comments on commit 5308806

Please sign in to comment.