pass annotation to create highlight call

This commit is contained in:
Satindar Dhillon 2022-03-24 13:00:21 -07:00
parent f3809d88a7
commit 7f8c794dfc
2 changed files with 5 additions and 2 deletions

View file

@ -56,7 +56,9 @@ struct WebReader: UIViewRepresentable {
webView.configuration.userContentController.add(webView, name: "viewerAction")
webView.configuration.userContentController.addScriptMessageHandler(context.coordinator, contentWorld: .page, name: "articleAction")
webView.configuration.userContentController.addScriptMessageHandler(
context.coordinator, contentWorld: .page, name: "articleAction"
)
context.coordinator.linkHandler = openLinkAction
context.coordinator.webViewActionHandler = webViewActionHandler

View file

@ -50,7 +50,8 @@ final class WebReaderViewModel: ObservableObject {
highlightID: messageBody["id"] as? String ?? "",
quote: messageBody["quote"] as? String ?? "",
patch: messageBody["patch"] as? String ?? "",
articleId: messageBody["articleId"] as? String ?? ""
articleId: messageBody["articleId"] as? String ?? "",
annotation: messageBody["annotation"] as? String ?? ""
)
.sink { completion in
guard case .failure = completion else { return }