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

Commit f30e440e authored by cketti's avatar cketti
Browse files

Merge branch 'pr-8494-backport' into beta

parents 4f43a0fc 24c1de99
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@ import app.k9mail.feature.onboarding.permissions.ui.PermissionsScreen
import app.k9mail.feature.onboarding.welcome.ui.WelcomeScreen
import app.k9mail.feature.settings.import.ui.SettingsImportAction
import app.k9mail.feature.settings.import.ui.SettingsImportScreen
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.koin.compose.koinInject

private const val NESTED_NAVIGATION_ROUTE_WELCOME = "welcome"
@@ -55,6 +58,7 @@ fun OnboardingNavHost(
    onFinish: (String?) -> Unit,
    hasRuntimePermissions: HasRuntimePermissions = koinInject(),
    onboardingMigrationManager: OnboardingMigrationManager = koinInject(),
    coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.Main),
) {
    val navController = rememberNavController()
    var accountUuid by rememberSaveable { mutableStateOf<String?>(null) }
@@ -120,7 +124,17 @@ fun OnboardingNavHost(
            SettingsImportScreen(
                action = SettingsImportAction.ScanQrCode,
                onImportSuccess = ::onImportSuccess,
                onBack = { navController.popBackStack() },
                onBack = {
                    // Fix for the navigation issue causing a ConcurrentModificationException when navigating back
                    // from the QR code scanner that is nested in the settings import fragment.
                    // There is a race condition when the fragment result listener is triggered and the
                    // fragment lifecycle is handled within the composable.
                    // This is a workaround to postpone immediate interaction with the nav controller,
                    // until we have a better solution.
                    coroutineScope.launch {
                        navController.popBackStack()
                    }
                },
            )
        }

+1 −1
Original line number Diff line number Diff line
@@ -6,10 +6,10 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.res.stringResource
import androidx.fragment.app.FragmentActivity
import androidx.fragment.compose.AndroidFragment
import androidx.lifecycle.compose.LocalLifecycleOwner
import app.k9mail.core.ui.compose.common.activity.LocalActivity
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonIcon
import app.k9mail.core.ui.compose.designsystem.atom.icon.Icons