1318: Remove 'visibilitychange' listener

Per 1318, we will only be sending data when user is done with a content, so this listener is no longer needed.

I think it was also not needed when we removed the beacon usage (it's mostly to prevent data loss when beacon is used), but we didn't remove it back then to avoid changing too many things and affecting the dataset.
This commit is contained in:
infinite-persistence 2022-05-24 13:29:17 +08:00 committed by Thomas Zarebczan
parent 13729a2ed4
commit ac44b771ff

View file

@ -267,13 +267,6 @@ const recsys: Recsys = {
}
},
};
// @if TARGET='web'
document.addEventListener('visibilitychange', function logData() {
if (document.visibilityState === 'hidden') {
Object.keys(recsys.entries).map((claimId) => recsys.sendRecsysEntry(claimId, true));
}
});
// @endif
history.listen(() => {
recsys.onNavigate();