mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #1147 from omnivore-app/fix/ios-theme-updater
Fix issues with theme not being properly updated in iOS when the system dark/light mode changes
This commit is contained in:
commit
014bfd0f32
4 changed files with 7 additions and 6 deletions
|
|
@ -300,7 +300,7 @@ public enum WebViewDispatchEvent {
|
|||
case let .updateFontSize(size: size):
|
||||
return "event.fontSize = '\(size)';"
|
||||
case let .updateColorMode(isDark: isDark):
|
||||
return "event.isDarkMode = '\(isDark)';"
|
||||
return "event.isDark = '\(isDark)';"
|
||||
case let .updateFontFamily(family: family):
|
||||
return "event.fontFamily = '\(family)';"
|
||||
case let .saveAnnotation(annotation: annotation):
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -3,7 +3,8 @@
|
|||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "webpack --mode production"
|
||||
"build": "webpack --mode production",
|
||||
"build-and-update": "yarn build && cp build/bundle.js ../../apple/OmnivoreKit/Sources/Views/Resources/bundle.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@omnivore/web": "1.0.0"
|
||||
|
|
|
|||
|
|
@ -125,12 +125,12 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element {
|
|||
}
|
||||
|
||||
interface UpdateColorModeEvent extends Event {
|
||||
isDark?: boolean
|
||||
isDark?: string
|
||||
}
|
||||
|
||||
const updateColorMode = (event: UpdateColorModeEvent) => {
|
||||
const isDark = event.isDark ?? false
|
||||
updateThemeLocally(isDark ? ThemeId.Dark : ThemeId.Light)
|
||||
const isDark = event.isDark ?? "false"
|
||||
updateThemeLocally(isDark === "true" ? ThemeId.Dark : ThemeId.Light)
|
||||
}
|
||||
|
||||
const share = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue