From 6aabd438afc645fe0324b374f9d4378d291e802f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Fridmansk=C3=BD?= Date: Fri, 14 Jun 2024 09:33:20 +0200 Subject: [PATCH] fix: opening url on footer press causes images to get stuck --- src/components/Content/index.tsx | 2 +- src/components/Footer/index.tsx | 2 +- src/components/Image/index.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Content/index.tsx b/src/components/Content/index.tsx index 5ba6018..6cddf43 100644 --- a/src/components/Content/index.tsx +++ b/src/components/Content/index.tsx @@ -26,7 +26,7 @@ const StoryContent: FC = ( { stories, active, activeStory } ) useAnimatedReaction( () => activeStory.value, ( res, prev ) => res !== prev && onChange(), - [ activeStory.value ], + [ activeStory.value, onChange ], ); const content = useMemo( () => stories[storyIndex]?.renderContent?.(), [ storyIndex ] ); diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 297f9d7..85c6444 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -26,7 +26,7 @@ const StoryFooter: FC = ( { stories, active, activeStory } ) useAnimatedReaction( () => activeStory.value, ( res, prev ) => res !== prev && onChange(), - [ activeStory.value ], + [ activeStory.value, onChange ], ); const footer = useMemo( () => stories[storyIndex]?.renderFooter?.(), [ storyIndex ] ); diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index 465fc6f..000e530 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -68,13 +68,13 @@ const StoryImage: FC = ( { useAnimatedReaction( () => isActive.value, ( res, prev ) => res !== prev && res && runOnJS( onImageChange )(), - [ isActive.value ], + [ isActive.value, onImageChange ], ); useAnimatedReaction( () => activeStory.value, ( res, prev ) => res !== prev && runOnJS( onImageChange )(), - [ activeStory.value ], + [ activeStory.value, onImageChange ], ); const onContentLoad = ( newDuration?: number ) => {