mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
use string rather than boolean to send js event
This commit is contained in:
parent
eddbcd293a
commit
fc49c54867
4 changed files with 5 additions and 8 deletions
File diff suppressed because one or more lines are too long
|
|
@ -505,7 +505,7 @@ public enum WebViewDispatchEvent {
|
|||
case .annotate, .highlight, .setHighlightLabels, .share, .remove, .copyHighlight, .dismissHighlight:
|
||||
return ""
|
||||
case let .handleAutoHighlightModeChange(isEnabled: isEnabled):
|
||||
return "event.enableHighlightOnRelease = '\(isEnabled)';"
|
||||
return "event.enableHighlightOnRelease = '\(isEnabled ? "on" : "off")';"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -151,14 +151,11 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element {
|
|||
}
|
||||
|
||||
interface UpdateHighlightModeEvent extends Event {
|
||||
enableHighlightOnRelease?: boolean
|
||||
enableHighlightOnRelease?: string
|
||||
}
|
||||
|
||||
const updateHighlightMode = (event: UpdateHighlightModeEvent) => {
|
||||
const isEnabled =
|
||||
event.enableHighlightOnRelease !== undefined
|
||||
? event.enableHighlightOnRelease
|
||||
: false
|
||||
const isEnabled = event.enableHighlightOnRelease === 'on'
|
||||
setHighlightOnRelease(isEnabled)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue