Skip to content

Commit

Permalink
include all identity providers in account setup view, instead of just…
Browse files Browse the repository at this point in the history
… the last per section
  • Loading branch information
lukaskollmer committed Dec 9, 2024
1 parent 273bd00 commit 752a89b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Sources/SpeziAccount/AccountSetup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,19 @@ public struct AccountSetup<Header: View, Continue: View>: View {
EmptyServicesWarning()
} else {
VStack {
let categorized = account.accountSetupComponents.reduce(into: OrderedDictionary()) { partialResult, component in
let components = account.accountSetupComponents.reduce(into: [AccountSetupSection: [any AnyAccountSetupComponent]]()) { dict, component in

Check failure on line 142 in Sources/SpeziAccount/AccountSetup.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Line Length Violation: Line should be 150 characters or less; currently it has 154 characters (line_length)
guard component.configuration.isEnabled else {
return
}
partialResult[component.configuration.section] = component
dict[component.configuration.section, default: []].append(component)
}

ForEach(categorized.keys.sorted(), id: \.self) { placement in
if let component = categorized[placement] {
component.anyView

if categorized.keys.last != placement {
ServicesDivider()
}
.sorted { $0.key < $1.key }
.flatMap(\.value)

ForEach(0..<components.endIndex, id: \.self) { idx in
components[idx].anyView
if idx < components.endIndex - 1 {
ServicesDivider()
}
}
}
Expand Down

0 comments on commit 752a89b

Please sign in to comment.