Auto fetch paid-content if already paid.

Seems odd to force users to manually "play" purchased files.
This commit is contained in:
infinite-persistence 2021-05-24 16:46:47 +08:00 committed by Jeremy Kauffman
parent b4da616176
commit b101cb304f

View file

@ -107,10 +107,13 @@ export default function FileRenderInitiator(props: Props) {
useEffect(() => {
const videoOnPage = document.querySelector('video');
if (isFree && ((autoplay && !videoOnPage && isPlayable) || RENDER_MODES.AUTO_RENDER_MODES.includes(renderMode))) {
if (
(isFree || claimWasPurchased) &&
((autoplay && !videoOnPage && isPlayable) || RENDER_MODES.AUTO_RENDER_MODES.includes(renderMode))
) {
viewFile();
}
}, [autoplay, viewFile, isFree, renderMode, isPlayable]);
}, [autoplay, viewFile, isFree, renderMode, isPlayable, claimWasPurchased]);
/*
once content is playing, let the appropriate <FileRender> take care of it...