fix(format-common): fix incorrect TOTP emission delay

Fixes #2167
This commit is contained in:
Harsh Shandilya 2022-12-19 15:18:55 +05:30
parent 5c35acdfbc
commit 93d51f0412
No known key found for this signature in database

View file

@ -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()