Skip to content

Commit e9c3502

Browse files
fix: description error
1 parent 5f8945c commit e9c3502

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/components/Analysis/Highlight.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,17 @@ export const Highlight: React.FC<Props> = ({
118118
}
119119

120120
// Track whether description exists (not its content)
121-
const hasDescriptionRef = useRef(boardDescription.segments.length > 0)
121+
const hasDescriptionRef = useRef(boardDescription?.segments?.length > 0)
122122
const [animationKey, setAnimationKey] = useState(0)
123123

124124
useEffect(() => {
125-
const descriptionNowExists = boardDescription.segments.length > 0
125+
const descriptionNowExists = boardDescription?.segments?.length > 0
126126
// Only trigger animation when presence changes (exists vs doesn't exist)
127127
if (hasDescriptionRef.current !== descriptionNowExists) {
128128
hasDescriptionRef.current = descriptionNowExists
129129
setAnimationKey((prev) => prev + 1)
130130
}
131-
}, [boardDescription.segments.length])
131+
}, [boardDescription?.segments?.length])
132132

133133
return (
134134
<div
@@ -272,7 +272,7 @@ export const Highlight: React.FC<Props> = ({
272272
</div>
273273
<div className="flex flex-col items-start justify-start bg-background-1/80 p-2 text-sm">
274274
<AnimatePresence mode="wait">
275-
{boardDescription.segments.length > 0 ? (
275+
{boardDescription?.segments?.length > 0 ? (
276276
<motion.div
277277
key={animationKey}
278278
initial={{ opacity: 0, y: 10 }}

src/pages/openings/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ const OpeningsPage: NextPage = () => {
725725
Analyzing Your Performance
726726
</h3>
727727
<p className="text-sm text-secondary">
728-
Running deep analysis with Stockfish and Maia...
728+
Running analysis with Stockfish and Maia...
729729
</p>
730730
</div>
731731
</div>

0 commit comments

Comments
 (0)