Skip to content

Commit

Permalink
fix: progress bar animation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFridmansky authored and Lipo11 committed Nov 14, 2023
1 parent b4eee48 commit fa1b936
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
13 changes: 11 additions & 2 deletions src/components/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const StoryImage: FC<StoryImageProps> = ( {

if ( data.uri === story.sourceUrl ) {

onLoad( videoDuration.value );
if ( !loading.value ) {

onLoad( videoDuration.value );

}

} else {

Expand Down Expand Up @@ -69,7 +73,12 @@ const StoryImage: FC<StoryImageProps> = ( {
}

loading.value = false;
onLoad( duration );

if ( isActive.value ) {

onLoad( duration );

}

};

Expand Down
8 changes: 1 addition & 7 deletions src/components/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ const StoryList: FC<StoryListProps> = ( {

};

const onImageLoad = ( duration?: number ) => {

onLoad( duration );

};

const lastSeenIndex = stories.findIndex(
( item ) => item.id === seenStories.value[id],
);
Expand All @@ -48,7 +42,7 @@ const StoryList: FC<StoryListProps> = ( {
defaultImage={stories[lastSeenIndex + 1]?.sourceUrl ?? stories[0]?.sourceUrl}
isDefaultVideo={( stories[lastSeenIndex + 1]?.mediaType ?? stories[0]?.mediaType ) === 'video'}
onImageLayout={onImageLayout}
onLoad={onImageLoad}
onLoad={onLoad}
paused={paused}
isActive={isActive}
videoProps={videoProps}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const StoryModal = forwardRef<StoryModalPublicMethods, StoryModalProps>( ( {
} else {

y.value = withTiming( 0 );
startAnimation();
startAnimation( true );

}

Expand Down

0 comments on commit fa1b936

Please sign in to comment.