Bypass account selection on import and export of OPML if only one account is available
This commit is contained in:
parent
e2816cba7a
commit
38200edb67
|
@ -76,7 +76,12 @@ struct SettingsView : View {
|
||||||
|
|
||||||
VStack {
|
VStack {
|
||||||
Button("Import Subscriptions...") {
|
Button("Import Subscriptions...") {
|
||||||
self.isOPMLImportPresented = true
|
if AccountManager.shared.activeAccounts.count == 1 {
|
||||||
|
self.opmlAccount = AccountManager.shared.activeAccounts.first
|
||||||
|
self.isOPMLImportDocPickerPresented = true
|
||||||
|
} else {
|
||||||
|
self.isOPMLImportPresented = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.actionSheet(isPresented: $isOPMLImportPresented) {
|
}.actionSheet(isPresented: $isOPMLImportPresented) {
|
||||||
buildSubscriptionsImportAccounts()
|
buildSubscriptionsImportAccounts()
|
||||||
|
@ -86,7 +91,12 @@ struct SettingsView : View {
|
||||||
|
|
||||||
VStack {
|
VStack {
|
||||||
Button("Export Subscriptions...") {
|
Button("Export Subscriptions...") {
|
||||||
self.isOPMLExportPresented = true
|
if AccountManager.shared.accounts.count == 1 {
|
||||||
|
self.opmlAccount = AccountManager.shared.accounts.first
|
||||||
|
self.isOPMLImportDocPickerPresented = true
|
||||||
|
} else {
|
||||||
|
self.isOPMLExportPresented = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.actionSheet(isPresented: $isOPMLExportPresented) {
|
}.actionSheet(isPresented: $isOPMLExportPresented) {
|
||||||
buildSubscriptionsExportAccounts()
|
buildSubscriptionsExportAccounts()
|
||||||
|
|
Loading…
Reference in New Issue