fix: search bar crash as new source added
This commit is contained in:
@@ -95,9 +95,6 @@ function DndWrapper({ items, setItems, children }: PropsWithChildren<{
|
||||
wait: AnimationDuration,
|
||||
})
|
||||
const { el } = useAtomValue(goToTopAtom)
|
||||
useEffect(() => {
|
||||
console.log(el)
|
||||
}, [el])
|
||||
return (
|
||||
<DndContext onDropTargetChange={run} autoscroll={el ? { element: el } : undefined}>
|
||||
{children}
|
||||
|
||||
@@ -47,7 +47,7 @@ export function SearchBar() {
|
||||
title: source.title,
|
||||
column: source.column ? columns[source.column].zh : "未分类",
|
||||
name: source.name,
|
||||
pinyin: pinyin?.[k as keyof typeof pinyin],
|
||||
pinyin: pinyin?.[k as keyof typeof pinyin] ?? "",
|
||||
})))
|
||||
, [],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user