🐛 Fixed handling of language/margin draft settings across renders
This commit is contained in:
parent
bca31494c6
commit
371a27f3fd
2 changed files with 6 additions and 2 deletions
|
@ -6,7 +6,9 @@ import { injectIntl } from "react-intl";
|
|||
import { languages } from "@freesewing/i18n";
|
||||
|
||||
const DraftSettingLanguage = props => {
|
||||
const [value, setValue] = useState(props.intl.locale);
|
||||
const [value, setValue] = useState(
|
||||
props.value === null ? props.intl.locale : props.value
|
||||
);
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
|
||||
const update = (name, newValue, evt) => {
|
||||
|
|
|
@ -5,7 +5,9 @@ import { formatMm, roundMm, sliderStep } from "@freesewing/utils";
|
|||
import OptionPreamble from "../OptionPreamble";
|
||||
|
||||
const DraftSettingMargin = props => {
|
||||
const [value, setValue] = useState(props.dflt);
|
||||
const [value, setValue] = useState(
|
||||
props.value === null ? props.dflt : props.value
|
||||
);
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
|
||||
const update = (name, newValue, evt) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue