From 38200edb67fbcaa36031c1e7c8ba65fcdc64ee36 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 15 Sep 2019 13:35:36 -0500 Subject: [PATCH] Bypass account selection on import and export of OPML if only one account is available --- iOS/Settings/SettingsView.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iOS/Settings/SettingsView.swift b/iOS/Settings/SettingsView.swift index a398a8033..041310167 100644 --- a/iOS/Settings/SettingsView.swift +++ b/iOS/Settings/SettingsView.swift @@ -76,7 +76,12 @@ struct SettingsView : View { VStack { 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) { buildSubscriptionsImportAccounts() @@ -86,7 +91,12 @@ struct SettingsView : View { VStack { 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) { buildSubscriptionsExportAccounts()