diff --git a/src/components/wired/views/actions/WiredActionSetFurniStateToView.tsx b/src/components/wired/views/actions/WiredActionSetFurniStateToView.tsx index 8916de4a..96261ddc 100644 --- a/src/components/wired/views/actions/WiredActionSetFurniStateToView.tsx +++ b/src/components/wired/views/actions/WiredActionSetFurniStateToView.tsx @@ -7,9 +7,9 @@ import { WiredActionBaseView } from './WiredActionBaseView'; export const WiredActionSetFurniStateToView: FC<{}> = props => { - const [ stateFlag, setStateFlag ] = useState(-1); - const [ directionFlag, setDirectionFlag ] = useState(-1); - const [ positionFlag, setPositionFlag ] = useState(-1); + const [ stateFlag, setStateFlag ] = useState(0); + const [ directionFlag, setDirectionFlag ] = useState(0); + const [ positionFlag, setPositionFlag ] = useState(0); const { trigger = null, setIntParams = null } = useWiredContext(); const save = () => setIntParams([ stateFlag, directionFlag, positionFlag ]); @@ -29,15 +29,15 @@ export const WiredActionSetFurniStateToView: FC<{}> = props => { LocalizeText('wiredfurni.params.conditions') } - setStateFlag(event.target.checked ? 1 : 0) } /> + setStateFlag(event.target.checked ? 1 : 0) } /> { LocalizeText('wiredfurni.params.condition.state') } - setDirectionFlag(event.target.checked ? 1 : 0) } /> + setDirectionFlag(event.target.checked ? 1 : 0) } /> { LocalizeText('wiredfurni.params.condition.direction') } - setPositionFlag(event.target.checked ? 1 : 0) } /> + setPositionFlag(event.target.checked ? 1 : 0) } /> { LocalizeText('wiredfurni.params.condition.position') } diff --git a/src/components/wired/views/conditions/WiredConditionFurniMatchesSnapshotView.tsx b/src/components/wired/views/conditions/WiredConditionFurniMatchesSnapshotView.tsx index 74420669..646a7c14 100644 --- a/src/components/wired/views/conditions/WiredConditionFurniMatchesSnapshotView.tsx +++ b/src/components/wired/views/conditions/WiredConditionFurniMatchesSnapshotView.tsx @@ -7,9 +7,9 @@ import { WiredConditionBaseView } from './WiredConditionBaseView'; export const WiredConditionFurniMatchesSnapshotView: FC<{}> = props => { - const [ stateFlag, setStateFlag ] = useState(-1); - const [ directionFlag, setDirectionFlag ] = useState(-1); - const [ positionFlag, setPositionFlag ] = useState(-1); + const [ stateFlag, setStateFlag ] = useState(0); + const [ directionFlag, setDirectionFlag ] = useState(0); + const [ positionFlag, setPositionFlag ] = useState(0); const { trigger = null, setIntParams = null } = useWiredContext(); const save = () => setIntParams([ stateFlag, directionFlag, positionFlag ]); @@ -23,21 +23,23 @@ export const WiredConditionFurniMatchesSnapshotView: FC<{}> = props => setPositionFlag(trigger.getBoolean(2) ? 1 : 0); }); }, [ trigger ]); + + console.log(stateFlag, directionFlag, positionFlag); return ( { LocalizeText('wiredfurni.params.conditions') } - setStateFlag(event.target.checked ? 1 : 0) } /> + setStateFlag(event.target.checked ? 1 : 0) } /> { LocalizeText('wiredfurni.params.condition.state') } - setDirectionFlag(event.target.checked ? 1 : 0) } /> + setDirectionFlag(event.target.checked ? 1 : 0) } /> { LocalizeText('wiredfurni.params.condition.direction') } - setPositionFlag(event.target.checked ? 1 : 0) } /> + setPositionFlag(event.target.checked ? 1 : 0) } /> { LocalizeText('wiredfurni.params.condition.position') }