mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Never decrement the lastUsage of a session duration limitation
This commit is contained in:
@@ -199,7 +199,9 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
|||||||
oldItem.roundedLastUpdate = roundedTimestampForSessionDuration
|
oldItem.roundedLastUpdate = roundedTimestampForSessionDuration
|
||||||
|
|
||||||
if (hasTrustedTimestamp) {
|
if (hasTrustedTimestamp) {
|
||||||
oldItem.lastUsage = action.trustedTimestamp.toString(10)
|
if (parseInt(oldItem.lastUsage, 10) < action.trustedTimestamp) {
|
||||||
|
oldItem.lastUsage = action.trustedTimestamp.toString(10)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await oldItem.save({ transaction: cache.transaction })
|
await oldItem.save({ transaction: cache.transaction })
|
||||||
|
|||||||
Reference in New Issue
Block a user