mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 00:33:28 +01:00
More improvements to unstable features and advanced settings
- added description of what they are and notice if there are none available - move them to advanced settings - add alert for unstable features in dev mode if the build does not have them enabled - move stuff out of the danger zone and into anisette section in advanced settings
This commit is contained in:
@@ -10,20 +10,36 @@
|
||||
import SwiftUI
|
||||
|
||||
struct UnstableFeaturesView: View {
|
||||
@ObservedObject private var shared = UnstableFeatures.shared
|
||||
@ObservedObject private var iO = Inject.observer
|
||||
|
||||
var inDevMode: Bool
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
ForEach(shared.features.filter { feature, _ in feature != .dummy && (inDevMode || feature.availableOutsideDevMode()) }.sorted(by: { _, _ in true }), id: \.key) { feature, _ in
|
||||
Toggle(isOn: Binding(get: { UnstableFeatures.enabled(feature) }, set: { newValue in UnstableFeatures.set(feature, enabled: newValue) })) {
|
||||
Text(String(describing: feature))
|
||||
let link = "https://github.com/SideStore/SideStore/issues/\(feature.rawValue)"
|
||||
Link(link, destination: URL(string: link)!)
|
||||
let features = UnstableFeatures.getFeatures(inDevMode)
|
||||
|
||||
let description = L10n.UnstableFeaturesView.description + (features.count <= 0 ? "\n\n" + L10n.UnstableFeaturesView.noUnstableFeatures : "")
|
||||
Section {} footer: {
|
||||
if #available(iOS 15.0, *),
|
||||
let string = try? AttributedString(markdown: description, options: AttributedString.MarkdownParsingOptions(interpretedSyntax: .inlineOnlyPreservingWhitespace)) {
|
||||
Text(string).font(.callout).foregroundColor(.primary)
|
||||
} else {
|
||||
Text(description).font(.callout).foregroundColor(.primary)
|
||||
}
|
||||
}.listRowInsets(EdgeInsets(top: 8, leading: 0, bottom: 8, trailing: 0))
|
||||
|
||||
if features.count > 0 {
|
||||
ForEach(features.sorted(by: { _, _ in true }), id: \.key) { feature, _ in
|
||||
Toggle(isOn: Binding(get: { UnstableFeatures.enabled(feature) }, set: { newValue in UnstableFeatures.set(feature, enabled: newValue) })) {
|
||||
Text(String(describing: feature))
|
||||
let link = "https://github.com/SideStore/SideStore/issues/\(feature.rawValue)"
|
||||
Link(link, destination: URL(string: link)!)
|
||||
}
|
||||
}
|
||||
}
|
||||
}.navigationTitle(L10n.UnstableFeaturesView.title)
|
||||
}
|
||||
.navigationTitle(L10n.UnstableFeaturesView.title)
|
||||
.enableInjection()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user