From 2aab536a94356bd5a0041c4cb7f00928dac40021 Mon Sep 17 00:00:00 2001 From: DrMint Date: Mon, 18 Jul 2022 02:09:29 +0200 Subject: [PATCH] Fixed a bug --- src/components/Chronicles/ChroniclesList.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Chronicles/ChroniclesList.tsx b/src/components/Chronicles/ChroniclesList.tsx index 47e40fc..6b299af 100644 --- a/src/components/Chronicles/ChroniclesList.tsx +++ b/src/components/Chronicles/ChroniclesList.tsx @@ -28,7 +28,9 @@ export const ChroniclesList = ({ currentSlug, title, }: Props): JSX.Element => { - const { state: isOpen, toggleState: toggleOpen } = useBoolean(false); + const { state: isOpen, toggleState: toggleOpen } = useBoolean( + chronicles.some((chronicle) => chronicle.attributes?.slug === currentSlug) + ); return (