Fix Find in page availability

This commit is contained in:
Balazs Perlaki-Horvath 2024-07-18 21:08:55 +02:00
parent 7075ec0c11
commit 57a8f4ea92
3 changed files with 6 additions and 6 deletions

View File

@ -212,7 +212,7 @@ private struct Content: View {
systemImage: "die.face.5",
action: { browser.loadRandomArticle() })
.disabled(zimFiles.isEmpty)
ContentSearchButton(webView: browser.webView)
ContentSearchButton()
}
}
}

View File

@ -43,7 +43,7 @@ struct BrowserTab: View {
#endif
BookmarkButton()
#if os(iOS)
ContentSearchButton(webView: browser.webView)
ContentSearchButton()
#endif
ArticleShortcutButtons(displayMode: .mainAndRandomArticle)
}

View File

@ -19,16 +19,16 @@ import WebKit
struct ContentSearchButton: View {
let webView: WKWebView
@EnvironmentObject private var browser: BrowserViewModel
var body: some View {
Button("common.search".localized,
systemImage: "text.magnifyingglass",
action: {
webView.isFindInteractionEnabled = true
webView.findInteraction?.presentFindNavigator(showingReplace: false)
browser.webView.isFindInteractionEnabled = true
browser.webView.findInteraction?.presentFindNavigator(showingReplace: false)
}
).disabled(webView.url == nil)
).disabled(browser.url == nil)
}
}
#endif