From 540320e6c05df9c8e5c10b4c1a18dc9bc642740f Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 17 Oct 2019 05:54:27 -0500 Subject: [PATCH] Change to use navigation stack instead of modal for account credential changes --- .../Account/SettingsDetailAccountView.swift | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/iOS/Settings/Account/SettingsDetailAccountView.swift b/iOS/Settings/Account/SettingsDetailAccountView.swift index d1c027a89..f67b29833 100644 --- a/iOS/Settings/Account/SettingsDetailAccountView.swift +++ b/iOS/Settings/Account/SettingsDetailAccountView.swift @@ -14,7 +14,7 @@ import RSWeb struct SettingsDetailAccountView : View { @Environment(\.presentationMode) var presentation @ObservedObject var viewModel: ViewModel - @State private var accountType: AccountType = nil + @State private var credentialsAction: Int? = nil @State private var isDeleteAlertPresented = false var body: some View { @@ -28,20 +28,21 @@ struct SettingsDetailAccountView : View { } } if viewModel.isCreditialsAvailable { - Section { - Button(action: { - self.accountType = self.viewModel.account.type - }) { + if viewModel.account.type == .feedbin { + NavigationLink(destination: self.settingsFeedbinAccountView, tag: 1, selection: $credentialsAction) { Text("Credentials") } + .modifier(VibrantSelectAction(action: { + self.credentialsAction = 1 + })) } - .sheet(item: $accountType) { type in - if type == .feedbin { - self.settingsFeedbinAccountView - } - if type == .freshRSS { - self.settingsReaderAPIAccountView + if viewModel.account.type == .freshRSS { + NavigationLink(destination: self.settingsReaderAPIAccountView, tag: 1, selection: $credentialsAction) { + Text("Credentials") } + .modifier(VibrantSelectAction(action: { + self.credentialsAction = 1 + })) } } if viewModel.isDeletable {