mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Restrict OPML import for Account types that don't support it
This commit is contained in:
@@ -93,19 +93,27 @@ struct SettingsView : View {
|
||||
|
||||
var createSubscriptionsImportAccounts: ActionSheet {
|
||||
var buttons = [ActionSheet.Button]()
|
||||
|
||||
for account in viewModel.activeAccounts {
|
||||
if !account.isOPMLImportSupported {
|
||||
continue
|
||||
}
|
||||
|
||||
let button = ActionSheet.Button.default(Text(verbatim: account.nameForDisplay)) {
|
||||
self.subscriptionsImportAccounts = nil
|
||||
self.subscriptionsImportDocumentPicker = Modal(SettingsSubscriptionsImportDocumentPickerView(account: account))
|
||||
}
|
||||
|
||||
buttons.append(button)
|
||||
}
|
||||
|
||||
buttons.append(.cancel { self.subscriptionsImportAccounts = nil })
|
||||
return ActionSheet(title: Text("Import Subscriptions..."), message: Text("Select the account to import your OPML file into."), buttons: buttons)
|
||||
}
|
||||
|
||||
var createSubscriptionsExportAccounts: ActionSheet {
|
||||
var buttons = [ActionSheet.Button]()
|
||||
|
||||
for account in viewModel.accounts {
|
||||
let button = ActionSheet.Button.default(Text(verbatim: account.nameForDisplay)) {
|
||||
self.subscriptionsExportAccounts = nil
|
||||
@@ -113,6 +121,7 @@ struct SettingsView : View {
|
||||
}
|
||||
buttons.append(button)
|
||||
}
|
||||
|
||||
buttons.append(.cancel { self.subscriptionsExportAccounts = nil })
|
||||
return ActionSheet(title: Text("Export Subscriptions..."), message: Text("Select the account to export out of."), buttons: buttons)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user