Fixed bug when switching between content pages not changing the content
This commit is contained in:
parent
e38f059c69
commit
6f69aaf236
|
@ -88,12 +88,11 @@ export default function Content(props: Props): JSX.Element {
|
||||||
}, [appLayout.preferredLanguages]);
|
}, [appLayout.preferredLanguages]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedTextSetIndex !== undefined)
|
if (selectedTextSetIndex !== undefined) {
|
||||||
setSelectedTextSet(content?.text_set?.[selectedTextSetIndex]);
|
setSelectedTextSet(content?.text_set?.[selectedTextSetIndex]);
|
||||||
if (selectedTextSetIndex !== undefined)
|
|
||||||
setSelectedTitle(content?.titles?.[selectedTextSetIndex]);
|
setSelectedTitle(content?.titles?.[selectedTextSetIndex]);
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
}
|
||||||
}, [selectedTextSetIndex]);
|
}, [content?.text_set, content?.titles, selectedTextSetIndex]);
|
||||||
|
|
||||||
const subPanel = (
|
const subPanel = (
|
||||||
<SubPanel>
|
<SubPanel>
|
||||||
|
|
Loading…
Reference in New Issue