From 93d51f0412e0e3597769a0173fcf8241f2df373c Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 19 Dec 2022 15:18:55 +0530 Subject: fix(format-common): fix incorrect TOTP emission delay Fixes #2167 --- .../src/main/kotlin/app/passwordstore/data/passfile/PasswordEntry.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'format-common') diff --git a/format-common/src/main/kotlin/app/passwordstore/data/passfile/PasswordEntry.kt b/format-common/src/main/kotlin/app/passwordstore/data/passfile/PasswordEntry.kt index cda8138e..b66e3f72 100644 --- a/format-common/src/main/kotlin/app/passwordstore/data/passfile/PasswordEntry.kt +++ b/format-common/src/main/kotlin/app/passwordstore/data/passfile/PasswordEntry.kt @@ -15,6 +15,7 @@ import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import kotlin.collections.set import kotlin.coroutines.coroutineContext +import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds import kotlin.time.ExperimentalTime import kotlinx.coroutines.awaitCancellation @@ -63,7 +64,7 @@ constructor( do { val otp = calculateTotp() emit(otp) - delay(ONE_SECOND.seconds) + delay(ONE_SECOND.milliseconds) } while (coroutineContext.isActive) } else { awaitCancellation() -- cgit v1.2.3