Disable checkbox if not configured yet

This commit is contained in:
ekzyis 2024-07-04 21:38:54 +02:00
parent da6d262e0a
commit 39d8928772
2 changed files with 4 additions and 3 deletions

View File

@ -16,7 +16,7 @@ export function autowithdrawInitial ({ me, priority = false }) {
} }
} }
export function AutowithdrawSettings ({ priority }) { export function AutowithdrawSettings ({ wallet }) {
const me = useMe() const me = useMe()
const threshold = autoWithdrawThreshold({ me }) const threshold = autoWithdrawThreshold({ me })
@ -29,6 +29,7 @@ export function AutowithdrawSettings ({ priority }) {
return ( return (
<> <>
<Checkbox <Checkbox
disabled={!wallet.isConfigured}
label='enabled' label='enabled'
id='priority' id='priority'
name='priority' name='priority'

View File

@ -65,10 +65,10 @@ export default function WalletSettings () {
> >
<WalletFields wallet={wallet} /> <WalletFields wallet={wallet} />
{wallet.server {wallet.server
? <AutowithdrawSettings /> ? <AutowithdrawSettings wallet={wallet} />
: ( : (
<ClientCheckbox <ClientCheckbox
disabled={false} disabled={!wallet.isConfigured}
initialValue={wallet.status === Status.Enabled} initialValue={wallet.status === Status.Enabled}
label='enabled' label='enabled'
name='enabled' name='enabled'