StoryViewer pause improvements

This commit is contained in:
Josh Perez 2022-11-17 14:54:28 -05:00 committed by GitHub
parent 897a4aa591
commit 9cd20b0f9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -312,6 +312,13 @@ export const StoryViewer = ({
animation.addEventListener('finish', onFinish);
// Reset the stuff that pauses a story when you switch story views
setConfirmDeleteStory(undefined);
setHasConfirmHideStory(false);
setHasExpandedCaption(false);
setIsShowingContextMenu(false);
setPauseStory(false);
return () => {
animation.removeEventListener('finish', onFinish);
animation.cancel();
@ -345,7 +352,7 @@ export const StoryViewer = ({
} else {
animationRef.current?.play();
}
}, [shouldPauseViewing]);
}, [shouldPauseViewing, story.messageId, storyDuration]);
useEffect(() => {
markStoryRead(messageId);