mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2025-10-03 09:49:32 +02:00
Never decrement the lastUsage of a session duration limitation
This commit is contained in:
parent
bc80ccc731
commit
9f2ea6e741
1 changed files with 3 additions and 1 deletions
|
@ -199,8 +199,10 @@ export async function dispatchAddUsedTimeVersion2 ({ deviceId, action, cache, ev
|
||||||
oldItem.roundedLastUpdate = roundedTimestampForSessionDuration
|
oldItem.roundedLastUpdate = roundedTimestampForSessionDuration
|
||||||
|
|
||||||
if (hasTrustedTimestamp) {
|
if (hasTrustedTimestamp) {
|
||||||
|
if (parseInt(oldItem.lastUsage, 10) < action.trustedTimestamp) {
|
||||||
oldItem.lastUsage = action.trustedTimestamp.toString(10)
|
oldItem.lastUsage = action.trustedTimestamp.toString(10)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await oldItem.save({ transaction: cache.transaction })
|
await oldItem.save({ transaction: cache.transaction })
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue