From ef96d296f8b47f00599e5ad5c6608b7ff441e23d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 21 Aug 2024 14:53:35 -0400 Subject: [PATCH] avoids double update to the viewmodel --- .../src/main/java/com/vitorpamplona/amethyst/ui/AppScreen.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/AppScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/AppScreen.kt index 0b6d37eb3..e063818d8 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/AppScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/AppScreen.kt @@ -42,10 +42,9 @@ fun prepareSharedViewModel(act: MainActivity): SharedPreferencesViewModel { LaunchedEffect(key1 = sharedPreferencesViewModel) { sharedPreferencesViewModel.init() - sharedPreferencesViewModel.updateDisplaySettings(windowSizeClass, displayFeatures) } - LaunchedEffect(key1 = displayFeatures, key2 = windowSizeClass) { + LaunchedEffect(sharedPreferencesViewModel, displayFeatures, windowSizeClass) { sharedPreferencesViewModel.updateDisplaySettings(windowSizeClass, displayFeatures) }