summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-03-26 22:51:48 +0530
committerGitHub <noreply@github.com>2021-03-26 22:51:48 +0530
commitf5450eb5fd6375c66f0ecebb05c34af6b2862d4c (patch)
tree6e1e560de07d6de5e06b7c328ce10a2eb5c804f3 /app/src
parent44d27333a741d04ccc2093ff77c8008a80ba9911 (diff)
DecryptActivity: use correct TOTP period (#1359)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivity.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivity.kt
index 9e70bb98..fe688b40 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivity.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivity.kt
@@ -190,7 +190,7 @@ class DecryptActivity : BasePgpActivity(), OpenPgpServiceConnection.OnBound {
if (entry.hasTotp()) {
launch(Dispatchers.IO) {
// Calculate the actual remaining time for the first pass
- // then return to the standard 30 second affair.
+ // then return to the standard rotation.
val remainingTime = entry.totpPeriod - (System.currentTimeMillis() % entry.totpPeriod)
withContext(Dispatchers.Main) {
val code = entry.calculateTotpCode() ?: "Error"
@@ -200,7 +200,7 @@ class DecryptActivity : BasePgpActivity(), OpenPgpServiceConnection.OnBound {
repeat(Int.MAX_VALUE) {
val code = entry.calculateTotpCode() ?: "Error"
withContext(Dispatchers.Main) { adapter.updateOTPCode(code) }
- delay(30.seconds)
+ delay(entry.totpPeriod.seconds)
}
}
}