Merge pull request #6350 from thundernest/fix_message_list_flash

Set app theme before the first Activity is started
This commit is contained in:
cketti 2022-10-05 15:22:58 +02:00 committed by GitHub
commit 2a8472ae87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -40,6 +40,9 @@ internal class RealGeneralSettingsManager(
} }
override fun getSettingsFlow(): Flow<GeneralSettings> { override fun getSettingsFlow(): Flow<GeneralSettings> {
// Make sure to load settings now if they haven't been loaded already. This will also update settingsFlow.
getSettings()
return settingsFlow.distinctUntilChanged() return settingsFlow.distinctUntilChanged()
} }

View file

@ -64,7 +64,7 @@ class ThemeManager(
.onEach { .onEach {
updateAppTheme(it) updateAppTheme(it)
} }
.launchIn(appCoroutineScope + Dispatchers.Main) .launchIn(appCoroutineScope + Dispatchers.Main.immediate)
} }
private fun updateAppTheme(appTheme: AppTheme) { private fun updateAppTheme(appTheme: AppTheme) {