fix view counts
This commit is contained in:
parent
adf75325fd
commit
0203f7a45f
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -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]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue