Fix stuck video poster when switching videos
## Issue With autoplay off, clicking on another video from the Recommended section didn't update the video poster. ## Fix Made a mistake assuming that the whole component will be re-mounted, so was only setting the thumbnail once.
This commit is contained in:
parent
c44beaf8fa
commit
e367b66a08
1 changed files with 6 additions and 4 deletions
|
@ -85,15 +85,17 @@ export default function FileRenderInitiator(props: Props) {
|
|||
containerRef.current.parentElement &&
|
||||
containerRef.current.parentElement.offsetWidth
|
||||
) {
|
||||
const dimen = containerRef.current.parentElement.offsetWidth;
|
||||
newThumbnail = getThumbnailCdnUrl({ thumbnail: newThumbnail, width: dimen, height: dimen });
|
||||
const w = containerRef.current.parentElement.offsetWidth;
|
||||
newThumbnail = getThumbnailCdnUrl({ thumbnail: newThumbnail, width: w, height: w });
|
||||
}
|
||||
// @endif
|
||||
|
||||
setThumbnail(newThumbnail);
|
||||
if (newThumbnail !== thumbnail) {
|
||||
setThumbnail(newThumbnail);
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
}, [claimThumbnail]);
|
||||
|
||||
function doAuthRedirect() {
|
||||
history.push(`/$/${PAGES.AUTH}?redirect=${encodeURIComponent(location.pathname)}`);
|
||||
|
|
Loading…
Reference in a new issue