Skip to content

Commit

Permalink
fix major bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mshdabiola committed May 25, 2024
1 parent 4691291 commit 6730ccd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
8 changes: 5 additions & 3 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ kotlin {
androidMain.dependencies {
implementation(libs.compose.ui.tooling.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.kotlinx.coroutines.android)

}
commonMain.dependencies {
//
Expand Down Expand Up @@ -135,9 +137,9 @@ kotlin {
}
}
}
configurations.commonMainApi {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-android")
}
// configurations.commonMainApi {
// exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-android")
// }

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SkeletonApplication : Application() {
super.onCreate()

val logger = Logger(
loggerConfigInit(platformLogWriter(), Writer(this.filesDir)),
loggerConfigInit(platformLogWriter()),
"AndroidLogger",
)
val logModule = module {
Expand All @@ -36,7 +36,7 @@ class SkeletonApplication : Application() {
KermitKoinLogger(Logger.withTag("koin")),
)
androidContext(this@SkeletonApplication)
modules(appModule, jankStatsModule)
modules(appModule, jankStatsModule,logModule)
}

// if (packageName.contains("debug")) {
Expand Down
6 changes: 5 additions & 1 deletion modules/database/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ android {
}
room {
schemaDirectory("$projectDir/schemas")
}
}

configurations.commonMainApi {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-android")
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ fun getDatabaseBuilder(context: Context): RoomDatabase.Builder<SkeletonDatabase>
context = appContext,
name = dbFile.absolutePath,
)
.setDriver(AndroidSQLiteDriver())
// .setDriver(AndroidSQLiteDriver())
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ import kotlinx.coroutines.flow.StateFlow

@Composable
actual fun <T> StateFlow<T>.collectAsStateWithLifecycleCommon(): State<T> {
return this.collectAsStateWithLifecycle()
return this.collectAsStateWithLifecycle(
lifecycleOwner = androidx.compose.ui.platform.LocalLifecycleOwner.current,
)
}

@Composable
actual fun <T> Flow<T>.collectAsStateWithLifecycleCommon(initialValue: T): State<T> {
return this.collectAsStateWithLifecycle(initialValue = initialValue)
return this.collectAsStateWithLifecycle(
lifecycleOwner = androidx.compose.ui.platform.LocalLifecycleOwner.current,

initialValue = initialValue)
}

// val ViewModel.viewModelScope: CoroutineScope
Expand Down

0 comments on commit 6730ccd

Please sign in to comment.