Fixed bug when switching between content pages not changing the content

This commit is contained in:
DrMint 2022-05-05 23:41:24 +02:00
parent e38f059c69
commit 6f69aaf236
1 changed files with 4 additions and 5 deletions

View File

@ -88,12 +88,11 @@ export default function Content(props: Props): JSX.Element {
}, [appLayout.preferredLanguages]);
useEffect(() => {
if (selectedTextSetIndex !== undefined)
if (selectedTextSetIndex !== undefined) {
setSelectedTextSet(content?.text_set?.[selectedTextSetIndex]);
if (selectedTextSetIndex !== undefined)
setSelectedTitle(content?.titles?.[selectedTextSetIndex]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedTextSetIndex]);
}
}, [content?.text_set, content?.titles, selectedTextSetIndex]);
const subPanel = (
<SubPanel>