mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-04-21 00:42:07 +00:00
Search: Fix sheet and results bug for iOS 15
In iOS 15, a searchbar will become inherited if a sheet call is within the searchable view and its children. Migrate the sheet call outside the search results view. Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
parent
74a610c2c0
commit
b88a6cf96f
2 changed files with 12 additions and 10 deletions
|
|
@ -10,6 +10,7 @@ import SwiftUI
|
||||||
struct ContentView: View {
|
struct ContentView: View {
|
||||||
@EnvironmentObject var scrapingModel: ScrapingViewModel
|
@EnvironmentObject var scrapingModel: ScrapingViewModel
|
||||||
@EnvironmentObject var debridManager: DebridManager
|
@EnvironmentObject var debridManager: DebridManager
|
||||||
|
@EnvironmentObject var navigationModel: NavigationViewModel
|
||||||
|
|
||||||
@AppStorage("RealDebrid.Enabled") var realDebridEnabled = false
|
@AppStorage("RealDebrid.Enabled") var realDebridEnabled = false
|
||||||
|
|
||||||
|
|
@ -77,9 +78,18 @@ struct ContentView: View {
|
||||||
}
|
}
|
||||||
.navigationTitle("Search")
|
.navigationTitle("Search")
|
||||||
}
|
}
|
||||||
|
.sheet(item: $navigationModel.currentChoiceSheet) { item in
|
||||||
|
Group {
|
||||||
|
switch item {
|
||||||
|
case .magnet:
|
||||||
|
MagnetChoiceView()
|
||||||
|
case .batch:
|
||||||
|
BatchChoiceView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tint(.primary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func performSearch() {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ContentView_Previews: PreviewProvider {
|
struct ContentView_Previews: PreviewProvider {
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,6 @@ struct SearchResultsView: View {
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
}
|
}
|
||||||
.sheet(item: $navigationModel.currentChoiceSheet) { item in
|
|
||||||
switch item {
|
|
||||||
case .magnet:
|
|
||||||
MagnetChoiceView()
|
|
||||||
case .batch:
|
|
||||||
BatchChoiceView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.tint(.primary)
|
.tint(.primary)
|
||||||
.padding(.bottom, 5)
|
.padding(.bottom, 5)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue