aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivity.kt8
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivityV2.kt8
2 files changed, 10 insertions, 6 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 b5f33012..1fd4ee60 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
@@ -31,6 +31,7 @@ import kotlin.time.ExperimentalTime
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect
+import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import logcat.LogPriority.ERROR
@@ -209,9 +210,10 @@ class DecryptActivity : BasePgpActivity(), OpenPgpServiceConnection.OnBound {
if (entry.hasTotp()) {
lifecycleScope.launch {
- entry.totp.collect { code ->
- withContext(Dispatchers.Main) { adapter.updateOTPCode(code) }
- }
+ entry
+ .totp
+ .onEach { code -> withContext(Dispatchers.Main) { adapter.updateOTPCode(code) } }
+ .collect()
}
}
}
diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivityV2.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivityV2.kt
index 40a721af..d7d376cc 100644
--- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivityV2.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/DecryptActivityV2.kt
@@ -28,6 +28,7 @@ import kotlin.time.ExperimentalTime
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect
+import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@@ -169,9 +170,10 @@ class DecryptActivityV2 : BasePgpActivity() {
if (entry.hasTotp()) {
lifecycleScope.launch {
- entry.totp.collect { code ->
- withContext(Dispatchers.Main) { adapter.updateOTPCode(code) }
- }
+ entry
+ .totp
+ .onEach { code -> withContext(Dispatchers.Main) { adapter.updateOTPCode(code) } }
+ .collect()
}
}
}