Skip to content

Commit

Permalink
fix: transaction position share checkbox value
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJJ committed Aug 2, 2024
1 parent ba7202f commit 8bd5805
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ const PositionTableRow: React.FC<PositionTableRowProps> = ({
{showAdvanced ? (
<NumericInput
sx={{ maxWidth: 50 }}
value={position.usages[accountID] !== undefined ? position.usages[String(accountID)] : 0}
value={(position.usages[accountID] ?? 0) !== 0 ? position.usages[accountID] : 0}
error={validationError && !!validationError.fieldErrors.usages}
onChange={(value) => updatePositionUsage(position, accountID, value)}
inputProps={{ tabIndex: -1 }}
/>
) : (
<Checkbox
name={`${accountID}-checked`}
checked={position.usages[accountID] !== undefined}
checked={(position.usages[accountID] ?? 0) !== 0}
onChange={(event) => updatePositionUsage(position, accountID, event.target.checked ? 1 : 0)}
inputProps={{ tabIndex: -1 }}
/>
Expand Down

0 comments on commit 8bd5805

Please sign in to comment.