Update some composition locals to not be static

This commit is contained in:
Aleksandras Kostarevas 2024-07-29 20:45:25 +03:00
parent a82d894a4b
commit cef7e286cd
2 changed files with 4 additions and 3 deletions

View File

@ -44,6 +44,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.staticCompositionLocalOf
@ -98,7 +99,7 @@ val LocalManager = staticCompositionLocalOf<KeyboardManagerForAction> {
error("No LocalManager provided")
}
val LocalThemeProvider = staticCompositionLocalOf<DynamicThemeProvider> {
val LocalThemeProvider = compositionLocalOf<DynamicThemeProvider> {
error("No LocalThemeProvider provided")
}

View File

@ -6,10 +6,10 @@ import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.compositionLocalOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.platform.LocalContext
import androidx.core.content.edit
import androidx.datastore.preferences.core.Preferences
@ -28,7 +28,7 @@ class DataStoreCache(
val currPreferences: Preferences
)
val LocalDataStoreCache = staticCompositionLocalOf<DataStoreCache?> {
val LocalDataStoreCache = compositionLocalOf<DataStoreCache?> {
null
}