mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fix issue when changing color mode, use update theme instead of updateColor mode
This prevents the Dark theme from being used instead of Black when changing theme on Android.
This commit is contained in:
parent
2feb2067f8
commit
a1952fb9e7
1 changed files with 2 additions and 2 deletions
|
|
@ -290,13 +290,13 @@ class WebReaderViewModel @Inject constructor(
|
|||
|
||||
fun updateStoredThemePreference(index: Int, isDarkMode: Boolean) {
|
||||
val newThemeKey = themeKey(isDarkMode, systemThemeKeys[index])
|
||||
Log.d("theme", "Setting theme key: ${newThemeKey}")
|
||||
|
||||
runBlocking {
|
||||
datastoreRepo.putString(DatastoreKeys.preferredTheme, systemThemeKeys[index])
|
||||
}
|
||||
|
||||
val isDark = newThemeKey == "Dark" || newThemeKey == "Black"
|
||||
val script = "var event = new Event('updateColorMode');event.isDark = '$isDark';document.dispatchEvent(event);"
|
||||
val script = "var event = new Event('updateTheme');event.themeName = '$newThemeKey';document.dispatchEvent(event);"
|
||||
enqueueScript(script)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue