fix view counts

This commit is contained in:
Sean Yesmunt 2020-02-04 01:02:39 -05:00
parent adf75325fd
commit 0203f7a45f
2 changed files with 2 additions and 2 deletions

View file

@ -88,7 +88,7 @@ export default function FileViewer(props: Props) {
const timeToStart = Date.now() - playTime; const timeToStart = Date.now() - playTime;
triggerAnalyticsView(uri, timeToStart).then(() => { triggerAnalyticsView(uri, timeToStart).then(() => {
claimRewards(); claimRewards();
setHasRecordedView(true); setHasRecordedView(false); // This is a terrible variable name, rename this
setPlayTime(null); setPlayTime(null);
}); });
} }

View file

@ -17,7 +17,7 @@ const EmbedWrapperPage = (props: Props) => {
useEffect(() => { useEffect(() => {
if (!hasRecordedView && uri && claim) { if (!hasRecordedView && uri && claim) {
triggerAnalyticsView(uri).then(() => { triggerAnalyticsView(uri).then(() => {
setHasRecordedView(true); setHasRecordedView(false);
}); });
} }
}, [triggerAnalyticsView, setHasRecordedView, hasRecordedView, uri, claim]); }, [triggerAnalyticsView, setHasRecordedView, hasRecordedView, uri, claim]);