From 6f5d711d3b3cefae95f36e50c107586db25a12e3 Mon Sep 17 00:00:00 2001 From: M3DZIK Date: Wed, 28 Feb 2024 22:19:39 +0100 Subject: [PATCH] Set `totpElapsed` without 1s delay --- .../medzik/librepass/android/ui/screens/vault/CipherView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt b/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt index 4288a85e..5ce3ebb0 100644 --- a/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt +++ b/app/src/main/java/dev/medzik/librepass/android/ui/screens/vault/CipherView.kt @@ -94,12 +94,12 @@ fun CipherViewScreen( totpCode = TOTPGenerator.now(params) while (true) { - delay(TimeUnit.SECONDS.toMillis(1)) - totpElapsed = calculateElapsed().toInt() if (totpElapsed == 30) { totpCode = TOTPGenerator.now(params) } + + delay(TimeUnit.SECONDS.toMillis(1)) } } }