Skip to content

Commit

Permalink
Fix remaining Codefactor and iOS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmoldrich committed Jan 17, 2025
1 parent f9e46f4 commit 89ad011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion App/App_macOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ struct Kiwix: App {
}
CommandGroup(after: .textEditing) {
Button("Search") {
let searchType = "com.apple.SwiftUI.search"
if let toolbar = NSApp.keyWindow?.toolbar,
let item = toolbar.items.first( where: { $0.itemIdentifier.rawValue == "com.apple.SwiftUI.search" } ),
let item = toolbar.items.first(where:{ $0.itemIdentifier.rawValue == searchType}),

Check notice on line 79 in App/App_macOS.swift

View check run for this annotation

codefactor.io / CodeFactor

App/App_macOS.swift#L79

Colons should be next to the identifier when specifying a type and next to the key in dictionary literals (colon)
let search = item as? NSSearchToolbarItem { search.beginSearchInteraction() }
}.keyboardShortcut("f", modifiers: [.command, .shift])
}
Expand Down
2 changes: 1 addition & 1 deletion Views/SearchResults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct SearchResults: View {

var body: some View {

if #available(macOS 14.0, *) {
if #available(macOS 14.0, iOS 17.0, *) {
SearchResultButtonBase(searchText: searchText, result: result, zimFile: zimFile)
.focusable()
.focused($searchFocus, equals: result.id)
Expand Down

0 comments on commit 89ad011

Please sign in to comment.