Skip to content

Commit

Permalink
fix: allow 0 as an animation duration on both source and thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
Efstathios Ntonas committed Jul 31, 2023
1 parent 4b01561 commit 071941c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/CachedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ const CachedImage = (props: IProps & typeof defaultProps) => {
animatedLoadingImage.value = withTiming(0, {}, () => {
animatedThumbnailImage.value = withTiming(1, {
duration:
props.thumbnailAnimationDuration ||
CacheManager?.config?.thumbnailAnimationDuration ||
100,
props.thumbnailAnimationDuration === 0
? 0
: props.thumbnailAnimationDuration ||
CacheManager?.config?.thumbnailAnimationDuration ||
100,
});
});
};
Expand All @@ -149,9 +151,11 @@ const CachedImage = (props: IProps & typeof defaultProps) => {
}
animatedImage.value = withTiming(1, {
duration:
props.sourceAnimationDuration ||
CacheManager?.config?.sourceAnimationDuration ||
1000,
props.sourceAnimationDuration === 0
? 0
: props.sourceAnimationDuration ||
CacheManager?.config?.sourceAnimationDuration ||
100,
});
};

Expand Down

0 comments on commit 071941c

Please sign in to comment.