mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 03:59:16 +01:00
Only use launchWhenCreated when the context isn't in nightmode already
This commit is contained in:
parent
a3f210dbf0
commit
29eec83389
@ -67,10 +67,14 @@ fun AppCompatActivity.setThemeAndNight(preferences: PreferencesHelper) {
|
||||
if (ThemeUtil.isColoredTheme(theme)) {
|
||||
setTheme(R.style.ThemeOverlay_Tachiyomi_AllBlue)
|
||||
}
|
||||
}
|
||||
if (!isInNightMode()) {
|
||||
lifecycle.coroutineScope.launchWhenCreated {
|
||||
AppCompatDelegate.setDefaultNightMode(preferences.nightMode().get())
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
AppCompatDelegate.setDefaultNightMode(preferences.nightMode().get())
|
||||
}
|
||||
|
||||
fun Context.getPrefTheme(preferences: PreferencesHelper): Themes {
|
||||
|
Loading…
Reference in New Issue
Block a user