mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 09:49:25 +02:00
Never decrement the lastUsage of a session duration limitation
This commit is contained in:
parent
12fb7778f1
commit
edc43734a8
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
|
* TimeLimit Copyright <C> 2019 - 2021 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -117,7 +117,7 @@ object LocalDatabaseAppLogicActionDispatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
oldItem.copy(
|
oldItem.copy(
|
||||||
lastUsage = if (hasTrustedTimestamp) action.trustedTimestamp else oldItem.lastUsage,
|
lastUsage = action.trustedTimestamp.coerceAtLeast(oldItem.lastUsage),
|
||||||
lastSessionDuration = if (extendSession) oldItem.lastSessionDuration + item.timeToAdd.toLong() else item.timeToAdd.toLong()
|
lastSessionDuration = if (extendSession) oldItem.lastSessionDuration + item.timeToAdd.toLong() else item.timeToAdd.toLong()
|
||||||
)
|
)
|
||||||
} else SessionDuration(
|
} else SessionDuration(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue