mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 03:39:19 +01:00
Fix crash when set theme not in use no longer exists
This commit is contained in:
parent
490b467ed2
commit
da76d4854f
@ -99,18 +99,7 @@ class SettingsGeneralController : SettingsController() {
|
|||||||
titleRes = R.string.app_theme
|
titleRes = R.string.app_theme
|
||||||
lastScrollPostionLight = lastThemeXLight
|
lastScrollPostionLight = lastThemeXLight
|
||||||
lastScrollPostionDark = lastThemeXDark
|
lastScrollPostionDark = lastThemeXDark
|
||||||
summary = if (preferences.nightMode()
|
summary = context.getString(context.getPrefTheme(preferences).nameRes)
|
||||||
.get() == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
|
||||||
) {
|
|
||||||
val lightTheme = preferences.lightTheme().get().nameRes
|
|
||||||
val darkTheme = preferences.darkTheme().get().nameRes
|
|
||||||
val nightMode = context.isInNightMode()
|
|
||||||
mutableListOf(context.getString(lightTheme), context.getString(darkTheme)).apply {
|
|
||||||
if (nightMode) reverse()
|
|
||||||
}.joinToString(" / ")
|
|
||||||
} else {
|
|
||||||
context.getString(context.getPrefTheme(preferences).nameRes)
|
|
||||||
}
|
|
||||||
activity = this@SettingsGeneralController.activity
|
activity = this@SettingsGeneralController.activity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user