Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a9cea7f authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

mail: Delay if new accounts were added

parent de9533ef
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.fsck.k9.activity.MessageList
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext

class EeloAccountActivity : ComponentActivity() {
@@ -46,7 +47,10 @@ class EeloAccountActivity : ComponentActivity() {
        var isTaskCompleted by remember { mutableStateOf(false) }

        LaunchedEffect(Unit) {
            runTask(this@EeloAccountActivity) // Run the task
            if (runTask(this@EeloAccountActivity)) {  // Run the task
                delay(3000) // Wait for 3 seconds if the task returns true
            }

            isTaskCompleted = true
            onTaskCompleted() // Navigate after task completion
        }
+3 −1
Original line number Diff line number Diff line
@@ -118,7 +118,9 @@ internal class EeloAccountCreator(context: Context) : KoinComponent {
                        accountManager,
                    )
                }
            return true
            // Return true if new accounts uuid were added
            return preferences.getAccounts()
                .any { it -> it.uuid !in accounts.map { it.uuid } }
        } catch (e: SecurityException) {
            Timber.d( "Failed to load accounts from accountManager because of security violation")
        }