Skip to content

Commit

Permalink
Fix a wrong time calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
DeweyReed committed Aug 26, 2023
1 parent d85b5c2 commit 92cec88
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ class FlavorUiInjectorImpl @Inject constructor(

val now = System.currentTimeMillis()

val requestTime = preferencesRepository.getLong(requestTimeKey, now)
if (!preferencesRepository.contains(requestTimeKey)) {
preferencesRepository.setLong(requestTimeKey, now)
}
val requestTime = preferencesRepository.getLong(requestTimeKey, 0L)
val launchTimes = preferencesRepository.getInt(launchTimesKey, 0) + 1
preferencesRepository.setInt(launchTimesKey, launchTimes)

Expand Down

0 comments on commit 92cec88

Please sign in to comment.