Skip to content

Commit

Permalink
Fix build (#2453)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Jan 3, 2025
1 parent bd7cadb commit e8edcc1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions deltachat-ios/Controller/WebViewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ class WebViewViewController: UIViewController, WKNavigationDelegate {
logger.error("internal search js not found")
return
}
do {
let data: Data = try Data(contentsOf: path)
let jsCode = String(data: data, encoding: .utf8)
// inject the search code
webView.evaluateJavaScript(jsCode, completionHandler: { _, error in
logger.error("\(String(describing: error))")
})
} catch {
logger.error("could not load javascript: \(error)")

guard let data = try? Data(contentsOf: path),
let jsCode = String(data: data, encoding: .utf8) else {
logger.error("could not load javascript")
return
}
// inject the search code
webView.evaluateJavaScript(jsCode, completionHandler: { _, error in
logger.error("\(String(describing: error))")
})
}

private func find(text: String) {
Expand Down

0 comments on commit e8edcc1

Please sign in to comment.