diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryListScreen.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryListScreen.kt index 825c68ff8..bb8272ead 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryListScreen.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryListScreen.kt @@ -128,8 +128,8 @@ import com.hippo.ehviewer.ui.tools.animateFloatMergePredictiveBackAsState import com.hippo.ehviewer.ui.tools.delegateSnapshotUpdate import com.hippo.ehviewer.ui.tools.foldToLoadResult import com.hippo.ehviewer.ui.tools.rememberHapticFeedback -import com.hippo.ehviewer.ui.tools.rememberInDataStore import com.hippo.ehviewer.ui.tools.rememberInVM +import com.hippo.ehviewer.ui.tools.rememberMutableStateInDataStore import com.hippo.ehviewer.ui.tools.snackBarPadding import com.hippo.ehviewer.util.FavouriteStatusRouter import com.hippo.ehviewer.util.pickVisualMedia @@ -175,7 +175,7 @@ fun GalleryListScreen(lub: ListUrlBuilder, navigator: DestinationsNavigator) = c var searchBarOffsetY by remember { mutableIntStateOf(0) } var showSearchLayout by rememberSaveable { mutableStateOf(false) } - var category by rememberInDataStore("SearchCategory") { EhUtils.ALL_CATEGORY } + var category by rememberMutableStateInDataStore("SearchCategory") { EhUtils.ALL_CATEGORY } var searchMethod by rememberSaveable { mutableIntStateOf(1) } var advancedSearchOption by rememberSaveable { mutableStateOf(AdvancedSearchOption()) } var imageUri by rememberSaveable { mutableStateOf(null) } diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/CircularLayout.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/CircularLayout.kt index 266469bd4..fa05cf383 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/CircularLayout.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/CircularLayout.kt @@ -35,7 +35,7 @@ fun CircularLayout( content: @Composable () -> Unit, ) { val coroutineScope = rememberCoroutineScope() - var delta by rememberInDataStore("FavDialogTheta") { 0F } + var delta by rememberMutableStateInDataStore("FavDialogTheta") { 0F } val state = rememberDraggable2DState { val prevOfs = currentOfs val prevTheta = currentTheta diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/RememberGlobally.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/RememberGlobally.kt index c65008a88..fdb1960cf 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/RememberGlobally.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/tools/RememberGlobally.kt @@ -59,7 +59,7 @@ inline fun rememberInVM( // Find out how make this work with any generic `Serializable` type @Composable -inline fun rememberInDataStore( +inline fun rememberMutableStateInDataStore( key: String, crossinline defaultValue: @DisallowComposableCalls () -> T, ) = with(dataStateFlow) {