Fix SwiftUI crash when deleting accounts

This commit is contained in:
Maurice Parker 2019-09-22 18:16:04 -05:00
parent b8d2a5a054
commit c9dc987f64
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ struct SettingsView : View {
func buildAccountsSection() -> some View {
Section(header: Text("ACCOUNTS").padding(.top, 22.0)) {
ForEach(0..<viewModel.accounts.count) { index in
ForEach(viewModel.accounts.indices, id: \.self) { index in
NavigationLink(destination: SettingsDetailAccountView(viewModel: SettingsDetailAccountView.ViewModel(self.viewModel.accounts[index])), tag: index, selection: self.$accountAction) {
Text(verbatim: self.viewModel.accounts[index].nameForDisplay)
}