diff --git a/app/core/src/main/java/com/fsck/k9/preferences/RealGeneralSettingsManager.kt b/app/core/src/main/java/com/fsck/k9/preferences/RealGeneralSettingsManager.kt index 93b5ed869..adb2c53ff 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/RealGeneralSettingsManager.kt +++ b/app/core/src/main/java/com/fsck/k9/preferences/RealGeneralSettingsManager.kt @@ -40,6 +40,9 @@ internal class RealGeneralSettingsManager( } override fun getSettingsFlow(): Flow { + // Make sure to load settings now if they haven't been loaded already. This will also update settingsFlow. + getSettings() + return settingsFlow.distinctUntilChanged() } diff --git a/app/ui/base/src/main/java/com/fsck/k9/ui/base/ThemeManager.kt b/app/ui/base/src/main/java/com/fsck/k9/ui/base/ThemeManager.kt index 104c7dbb2..4eef05baf 100644 --- a/app/ui/base/src/main/java/com/fsck/k9/ui/base/ThemeManager.kt +++ b/app/ui/base/src/main/java/com/fsck/k9/ui/base/ThemeManager.kt @@ -64,7 +64,7 @@ class ThemeManager( .onEach { updateAppTheme(it) } - .launchIn(appCoroutineScope + Dispatchers.Main) + .launchIn(appCoroutineScope + Dispatchers.Main.immediate) } private fun updateAppTheme(appTheme: AppTheme) {