fix: clamp negative playtime (#6519)

* fix: clamp negative playtime

* fix: remove triggers use instant
This commit is contained in:
Calum H.
2026-06-26 17:50:03 +02:00
committed by GitHub
parent 5fe07de187
commit e4376c2b15
11 changed files with 135 additions and 70 deletions
+5 -6
View File
@@ -1341,12 +1341,11 @@ async function processPendingSurveys() {
const creds = await getCreds().catch(handleError)
const userId = creds?.user_id
const instances = await list().catch(handleError)
const isActivePlayer =
instances.findIndex(
(instance) =>
isWithinLastTwoWeeks(instance.last_played) && !isWithinLastTwoWeeks(instance.created),
) >= 0
const instances = (await list().catch(handleError)) ?? []
const isActivePlayer = instances.some(
(instance) =>
isWithinLastTwoWeeks(instance.last_played) && !isWithinLastTwoWeeks(instance.created),
)
let surveys = []
try {