mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fixes #3721
- Disables Continue button until a selection is made. - Defaults to the first available extension point if one is available
This commit is contained in:
@@ -15,10 +15,10 @@ struct EnableExtensionPointView: View {
|
||||
|
||||
weak var parent: NSHostingController<EnableExtensionPointView>? // required because presentationMode.dismiss() doesn't work
|
||||
weak var enabler: ExtensionPointPreferencesEnabler?
|
||||
@State private var extensionPointTypeName = String(describing: Self.sendToCommandExtensionPointTypes.first)
|
||||
@State private var extensionPointTypeName = ""
|
||||
private var selectedType: ExtensionPoint.Type?
|
||||
|
||||
init(enabler: ExtensionPointPreferencesEnabler?, selectedType: ExtensionPoint.Type? ) {
|
||||
init(enabler: ExtensionPointPreferencesEnabler?, selectedType: ExtensionPoint.Type?) {
|
||||
self.enabler = enabler
|
||||
self.selectedType = selectedType
|
||||
}
|
||||
@@ -99,6 +99,11 @@ struct EnableExtensionPointView: View {
|
||||
.foregroundColor(.gray)
|
||||
.font(.caption)
|
||||
.padding(.horizontal)
|
||||
.onAppear {
|
||||
if extensionPointTypeName.count == 0 {
|
||||
self.extensionPointTypeName = extensionPointTypeNames.first!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +164,7 @@ struct EnableExtensionPointView: View {
|
||||
}
|
||||
|
||||
func disableContinue() -> Bool {
|
||||
ExtensionPointManager.shared.availableExtensionPointTypes.count == 0
|
||||
ExtensionPointManager.shared.availableExtensionPointTypes.count == 0 || extensionPointTypeName.count == 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user