perf: dark theme debounce

This commit is contained in:
lisonge 2024-08-20 11:24:05 +08:00
parent db06633bfb
commit f66c49ce65

View File

@ -25,7 +25,7 @@ import li.songe.gkd.util.storeFlow
import li.songe.gkd.util.updateSubscription
class MainViewModel : ViewModel() {
val enableDarkThemeFlow = storeFlow.debounce(200).map { s -> s.enableDarkTheme }.stateIn(
val enableDarkThemeFlow = storeFlow.debounce(300).map { s -> s.enableDarkTheme }.stateIn(
viewModelScope,
SharingStarted.Eagerly,
storeFlow.value.enableDarkTheme