<@UHAJKUSTU> I am facing this weird error when nav...
# decompose
v
@Arkadii Ivanov I am facing this weird error when navigating
Copy code
Expected to be called on the main thread, but was DefaultDispatcher-worker-2
com.arkivanov.decompose.mainthread.NotOnMainThreadException: Expected to be called on the main thread, but was DefaultDispatcher-worker-2
Even though im not calling navigate from any coroutine I even tried adding this
launch(Dispatchers.Main)
intentionally, but i still get this error
Copy code
private fun navigate(
    screen: ScreenConfig,
    replace: Boolean = false,
    replaceAll: Boolean = false
) = rootComponent.scope.launch(Dispatchers.Main){
    when {
        replaceAll -> navigator.replaceAll(screen)
        replace -> navigator.navigate {
            it.dropLast(1) - screen + screen
        }
        else -> navigator.pushToFront(screen)
    }
}