diff --git a/src/renderer/src/modules/feed-column/index.tsx b/src/renderer/src/modules/feed-column/index.tsx index 3472fcd81..327b27255 100644 --- a/src/renderer/src/modules/feed-column/index.tsx +++ b/src/renderer/src/modules/feed-column/index.tsx @@ -97,7 +97,14 @@ export function FeedColumn({ children }: PropsWithChildren) { }, [setActive_]) useLayoutEffect(() => { + const handler = () => { + spring.jump(-active * jotaiStore.get(carouselWidthAtom)) + } + const dispose = jotaiStore.sub(carouselWidthAtom, handler) spring.set(-active * jotaiStore.get(carouselWidthAtom)) + return () => { + dispose() + } }, [active, spring]) useHotkeys(