Skip to content

Commit

Permalink
fix: empty string no return default value
Browse files Browse the repository at this point in the history
  • Loading branch information
longxiaofei committed Jun 18, 2024
1 parent 3e70754 commit 6465d25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/graphic-walker/src/components/limitSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const useDebounceValueBind = createStreamedValueBindHook((f) => debounce(f, 600
export default function LimitSetting(props: { value: number; setValue: (v: number) => void }) {
const { t } = useTranslation('translation', { keyPrefix: 'main.tabpanel.settings' });
const [enable, setEnable] = React.useState(props.value > 0);
const [innerValue, setInnerValue] = useDebounceValueBind(props.value <= 0 ? 100: props.value, (v) => enable && props.setValue(v));
const [innerValue, setInnerValue] = useDebounceValueBind(props.value > 0 ? props.value : 100, (v) => enable && props.setValue(v));

return (
<div className="w-60 mt-2 p-2">
Expand Down

0 comments on commit 6465d25

Please sign in to comment.