Ferrite: Update to support iOS 16.4 and Swift 5.8

Xcode 14.3 changed many parts about swift which caused Ferrite to
not compile.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2023-04-08 17:26:43 -04:00
parent d5ba67503b
commit fbd99752e4
7 changed files with 23 additions and 24 deletions

View file

@ -36,7 +36,8 @@ struct InstalledPluginButtonView<P: Plugin>: View {
.lineLimit(1)
}
if let tags = installedPlugin.getTags(), !tags.isEmpty {
let tags = installedPlugin.getTags()
if !tags.isEmpty {
PluginTagsView(tags: tags)
}
}

View file

@ -33,7 +33,8 @@ struct PluginCatalogButtonView<PJ: PluginJson>: View {
.lineLimit(1)
}
if let tags = availablePlugin.getTags(), !tags.isEmpty {
let tags = availablePlugin.getTags()
if !tags.isEmpty {
PluginTagsView(tags: tags)
}
}

View file

@ -44,7 +44,8 @@ struct PluginInfoMetaView<P: Plugin>: View {
.font(.caption)
}
if let tags = selectedPlugin.getTags(), !tags.isEmpty {
let tags = selectedPlugin.getTags()
if !tags.isEmpty {
PluginTagsView(tags: tags)
}
}

View file

@ -33,13 +33,12 @@ struct PluginAggregateView<P: Plugin, PJ: PluginJson>: View {
var body: some View {
List {
if
let filteredUpdatedPlugins = pluginManager.fetchUpdatedPlugins(
forType: PJ.self,
installedPlugins: installedPlugins,
searchText: searchText
),
!filteredUpdatedPlugins.isEmpty
let filteredUpdatedPlugins = pluginManager.fetchUpdatedPlugins(
forType: PJ.self,
installedPlugins: installedPlugins,
searchText: searchText
)
if !filteredUpdatedPlugins.isEmpty
{
Section(header: InlineHeader("Updates")) {
ForEach(filteredUpdatedPlugins, id: \.self) { (updatedPlugin: PJ) in
@ -60,13 +59,13 @@ struct PluginAggregateView<P: Plugin, PJ: PluginJson>: View {
}
}
if
let filteredAvailablePlugins = pluginManager.fetchFilteredPlugins(
forType: PJ.self,
installedPlugins: installedPlugins,
searchText: searchText
),
!filteredAvailablePlugins.isEmpty
let filteredAvailablePlugins = pluginManager.fetchFilteredPlugins(
forType: PJ.self,
installedPlugins: installedPlugins,
searchText: searchText
)
if !filteredAvailablePlugins.isEmpty
{
Section(header: InlineHeader("Catalog")) {
ForEach(filteredAvailablePlugins, id: \.self) { availablePlugin in

View file

@ -26,8 +26,8 @@ struct SearchFilterHeaderView: View {
Text("None").tag(nil as Source?)
ForEach(sources, id: \.self) { source in
if let name = source.name, source.enabled {
Text(name)
if source.enabled {
Text(source.name)
.tag(Source?.some(source))
}
}

View file

@ -54,8 +54,6 @@ struct MainView: View {
case .batch:
BatchChoiceView()
case .activity:
EmptyView()
// TODO: Fix share sheet
if #available(iOS 16, *) {
ShareSheet(activityItems: navModel.activityItems)
.presentationDetents([.medium, .large])

View file

@ -80,8 +80,7 @@ struct SettingsView: View {
}
Section(header: InlineHeader("Default actions")) {
// TODO: Uncomment
//if debridManager.enabledDebrids.count > 0 {
if debridManager.enabledDebrids.count > 0 {
NavigationLink {
DefaultActionPickerView(
actionRequirement: .debrid,
@ -108,7 +107,7 @@ struct SettingsView: View {
.foregroundColor(.secondary)
}
}
//}
}
NavigationLink {
DefaultActionPickerView(