StoryViewer pause improvements
This commit is contained in:
parent
897a4aa591
commit
9cd20b0f9b
1 changed files with 8 additions and 1 deletions
|
@ -312,6 +312,13 @@ export const StoryViewer = ({
|
||||||
|
|
||||||
animation.addEventListener('finish', onFinish);
|
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 () => {
|
return () => {
|
||||||
animation.removeEventListener('finish', onFinish);
|
animation.removeEventListener('finish', onFinish);
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
|
@ -345,7 +352,7 @@ export const StoryViewer = ({
|
||||||
} else {
|
} else {
|
||||||
animationRef.current?.play();
|
animationRef.current?.play();
|
||||||
}
|
}
|
||||||
}, [shouldPauseViewing]);
|
}, [shouldPauseViewing, story.messageId, storyDuration]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
markStoryRead(messageId);
|
markStoryRead(messageId);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue