feat: fixed the issue where chat greetings could not appear (#95)

This commit is contained in:
balibabu
2024-03-05 12:01:48 +08:00
committed by GitHub
parent eec529f8c5
commit 59d8442d0d
8 changed files with 56 additions and 18 deletions

View File

@ -41,7 +41,8 @@ export const useGetChunkHighlights = (
const selectedChunk: IChunk = useGetSelectedChunk(selectedChunkId);
const highlights: IHighlight[] = useMemo(() => {
return Array.isArray(selectedChunk?.positions)
return Array.isArray(selectedChunk?.positions) &&
selectedChunk.positions.every((x) => Array.isArray(x))
? selectedChunk?.positions?.map((x) => {
const actualPositions = x.map((y, index) =>
index !== 0 ? y / 0.7 : y,