chore(frontend): refactor navigation and DI setup, remove unused shared module
- Replaced `initKoin` with `startKoin` for DI initialization consistency across platforms. - Introduced `StateNavigationPort` with `StateFlow` to streamline navigation state management. - Migrated `AppScreen` to sealed class with route mapping for better navigation handling. - Deleted unused `frontend/shared` module and removed related dependencies from build files. - Cleaned up legacy navigation and Redux-related code, aligning with MVVM architecture.
This commit is contained in:
-10
@@ -1,10 +0,0 @@
|
||||
package at.mocode.clients.shared.navigation
|
||||
|
||||
sealed class AppScreen {
|
||||
data object Landing : AppScreen()
|
||||
data object Home : AppScreen()
|
||||
data object Login : AppScreen()
|
||||
data object Ping : AppScreen()
|
||||
data object Profile : AppScreen()
|
||||
data object AuthCallback : AppScreen()
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package at.mocode.frontend.core.navigation
|
||||
|
||||
sealed class AppScreen(val route: String) {
|
||||
data object Landing : AppScreen(Routes.HOME)
|
||||
data object Home : AppScreen("/home")
|
||||
data object Login : AppScreen(Routes.LOGIN)
|
||||
data object Ping : AppScreen("/ping")
|
||||
data object Profile : AppScreen("/profile")
|
||||
data object AuthCallback : AppScreen("/auth/callback")
|
||||
|
||||
companion object {
|
||||
fun fromRoute(route: String): AppScreen {
|
||||
return when (route) {
|
||||
Routes.HOME -> Landing
|
||||
"/home" -> Home
|
||||
Routes.LOGIN, Routes.Auth.LOGIN -> Login
|
||||
"/ping" -> Ping
|
||||
"/profile" -> Profile
|
||||
"/auth/callback" -> AuthCallback
|
||||
else -> Landing // Default fallback
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -28,7 +28,7 @@ class DeepLinkHandler(
|
||||
private fun processDeepLink(deepLink: DeepLink): Boolean {
|
||||
val route = cleanRoute(deepLink.route)
|
||||
|
||||
// If route requires auth and user is missing → redirect to login
|
||||
// If the route requires auth and the user is missing → redirect to log in
|
||||
if (requiresAuth(route)) {
|
||||
val user = currentUserProvider.getCurrentUser()
|
||||
if (user == null) {
|
||||
|
||||
Reference in New Issue
Block a user