From bad7d7ed49575f158d29964ba8fa5d874a142be3 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Tue, 22 Oct 2024 20:17:30 +0500 Subject: [PATCH] fix bug 71024 --- apps/documenteditor/mobile/src/view/Encoding.jsx | 2 +- apps/spreadsheeteditor/mobile/src/view/Encoding.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/mobile/src/view/Encoding.jsx b/apps/documenteditor/mobile/src/view/Encoding.jsx index de9bddb55e..10231c534c 100644 --- a/apps/documenteditor/mobile/src/view/Encoding.jsx +++ b/apps/documenteditor/mobile/src/view/Encoding.jsx @@ -7,7 +7,7 @@ const PageEncoding = props => { const { t } = useTranslation(); const _t = t("Settings", { returnObjects: true }); const encodeData = props.encodeData; - const [stateEncoding, setStateEncoding] = useState(props.valueEncoding); + const [stateEncoding, setStateEncoding] = useState(props.valueEncoding === -1 ? encodeData.find(encoding => encoding.lcid === 65001).value : props.valueEncoding); const getIndexNameEncoding = () => encodeData.findIndex(encoding => encoding.value === stateEncoding); const nameEncoding = encodeData[getIndexNameEncoding()].displayValue; const mode = props.mode; diff --git a/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx b/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx index 8899d960f0..66799674ac 100644 --- a/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/Encoding.jsx @@ -9,7 +9,7 @@ const PageEncoding = props => { const encodeData = props.encodeData; const valuesDelimeter = props.valuesDelimeter; const namesDelimeter = props.namesDelimeter; - const [stateEncoding, setStateEncoding] = useState(props.valueEncoding); + const [stateEncoding, setStateEncoding] = useState(props.valueEncoding === -1 ? encodeData.find(encoding => encoding.lcid === 65001).value : props.valueEncoding); const [stateDelimeter, setStateDelimeter] = useState(props.valueDelimeter); const getIndexNameEncoding = () => encodeData.findIndex(encoding => encoding.value === stateEncoding); const nameEncoding = encodeData[getIndexNameEncoding()].displayValue;