From 16df47a120e06dfedf561e16aac37ff72f255940 Mon Sep 17 00:00:00 2001 From: Aleksandar Ilic Date: Wed, 6 Mar 2024 19:16:44 +0100 Subject: [PATCH] Remove applying default theme on app cold start --- .../main/kotlin/net/primal/android/MainActivity.kt | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/main/kotlin/net/primal/android/MainActivity.kt b/app/src/main/kotlin/net/primal/android/MainActivity.kt index e5751287..f1129661 100644 --- a/app/src/main/kotlin/net/primal/android/MainActivity.kt +++ b/app/src/main/kotlin/net/primal/android/MainActivity.kt @@ -39,7 +39,7 @@ class MainActivity : ComponentActivity() { setContent { val userTheme = themeStore.userThemeState.collectAsState() - val primalTheme = userTheme.value ?: initDefaultTheme() + val primalTheme = userTheme.value ?: defaultPrimalTheme() PrimalTheme( primalTheme = primalTheme, @@ -54,15 +54,6 @@ class MainActivity : ComponentActivity() { } } - @Composable - private fun initDefaultTheme(): PrimalTheme { - val defaultTheme = defaultPrimalTheme() - LaunchedEffect(Unit) { - themeStore.setUserTheme(theme = defaultTheme.themeName) - } - return defaultTheme - } - private fun observeThemeChanges() = lifecycleScope.launch { themeStore.userThemeState