diff --git a/frontend/core/sync/src/commonMain/kotlin/at/mocode/frontend/core/sync/di/SyncModule.kt b/frontend/core/sync/src/commonMain/kotlin/at/mocode/frontend/core/sync/di/SyncModule.kt index b838a57e..385a96c3 100644 --- a/frontend/core/sync/src/commonMain/kotlin/at/mocode/frontend/core/sync/di/SyncModule.kt +++ b/frontend/core/sync/src/commonMain/kotlin/at/mocode/frontend/core/sync/di/SyncModule.kt @@ -1,12 +1,13 @@ package at.mocode.frontend.core.sync.di import at.mocode.frontend.core.sync.SyncManager +import org.koin.core.qualifier.named import org.koin.dsl.module /** * Zentrales Koin-Modul für den Sync-Core. */ val syncModule = module { - // Provides a singleton instance of SyncManager, using the globally provided HttpClient. - single { SyncManager(get()) } + // Provides a singleton instance of SyncManager, using the authenticated 'apiClient'. + single { SyncManager(get(named("apiClient"))) } } diff --git a/frontend/shells/meldestelle-portal/src/jvmMain/kotlin/main.kt b/frontend/shells/meldestelle-portal/src/jvmMain/kotlin/main.kt index 86daca86..63ce654a 100644 --- a/frontend/shells/meldestelle-portal/src/jvmMain/kotlin/main.kt +++ b/frontend/shells/meldestelle-portal/src/jvmMain/kotlin/main.kt @@ -9,6 +9,7 @@ import at.mocode.frontend.core.sync.di.syncModule import at.mocode.ping.feature.di.pingFeatureModule import at.mocode.frontend.core.localdb.AppDatabase import at.mocode.frontend.core.localdb.DatabaseProvider +import at.mocode.frontend.core.localdb.localDbModule import navigation.navigationModule import kotlinx.coroutines.runBlocking import org.koin.core.context.loadKoinModules @@ -18,8 +19,8 @@ fun main() = application { // Initialize DI (Koin) with shared modules + network module try { // Updated: Only load the consolidated pingFeatureModule from at.mocode.ping.feature.di - initKoin { modules(networkModule, syncModule, pingFeatureModule, authFeatureModule, navigationModule) } - println("[DesktopApp] Koin initialized with networkModule + authFeatureModule + navigationModule + pingFeatureModule") + initKoin { modules(networkModule, syncModule, pingFeatureModule, authFeatureModule, navigationModule, localDbModule) } + println("[DesktopApp] Koin initialized with networkModule + authFeatureModule + navigationModule + pingFeatureModule + localDbModule") } catch (e: Exception) { println("[DesktopApp] Koin initialization warning: ${e.message}") }