Grab new story duration whenever messageId changes
This commit is contained in:
parent
726e67ce95
commit
808118d1e4
1 changed files with 4 additions and 1 deletions
|
@ -196,6 +196,9 @@ export const StoryViewer = ({
|
|||
setHasExpandedCaption(false);
|
||||
}, [messageId]);
|
||||
|
||||
// messageId is set as a dependency so that we can reset the story duration
|
||||
// when a new story is selected in case the same story (and same attachment)
|
||||
// are sequentially posted.
|
||||
useEffect(() => {
|
||||
let shouldCancel = false;
|
||||
(async function hydrateStoryDuration() {
|
||||
|
@ -218,7 +221,7 @@ export const StoryViewer = ({
|
|||
return () => {
|
||||
shouldCancel = true;
|
||||
};
|
||||
}, [attachment]);
|
||||
}, [attachment, messageId]);
|
||||
|
||||
const unmountRef = useRef<boolean>(false);
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Add table
Reference in a new issue