Skip to content

Commit

Permalink
Fix appearance of AccountSetup Header when only using identity provid…
Browse files Browse the repository at this point in the history
…er (#58)

# Fix appearance of AccountSetup Header when only using identity
provider

## ♻️ Current situation & Problem
There was a faulty check resulting in the AccountSetup Header not being
displayed when only using Identity Provider.

## ⚙️ Release Notes 
* Fixed an issue where the AccountSetup Header wouldn't be displayed
with only using identity provider.


## 📚 Documentation
--


## ✅ Testing
We added another permutation in the Preview section.


## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
Supereg authored May 7, 2024
1 parent 83f505c commit 2de0720
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/SpeziAccount/Account.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public final class Account: @unchecked Sendable {
/// ``AccountSetupViewStyle`` implementations (see ``IdentityProviderViewStyle``).
public let registeredAccountServices: [any AccountService]


/// Initialize a new `Account` object by providing all properties individually.
/// - Parameters:
/// - services: A collection of ``AccountService`` that are used to handle account-related functionality.
Expand Down
5 changes: 4 additions & 1 deletion Sources/SpeziAccount/AccountSetup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public struct AccountSetup<Header: View, Continue: View>: View {
GeometryReader { proxy in
ScrollView(.vertical) {
VStack {
if !services.isEmpty {
if !services.isEmpty || !identityProviders.isEmpty {
header
.environment(\._accountSetupState, setupState)
}
Expand Down Expand Up @@ -240,6 +240,9 @@ struct AccountView_Previews: PreviewProvider {
.environment(Account(services: accountServicePermutations[index] + [MockSignInWithAppleProvider()]))
}

AccountSetup()
.environment(Account(services: [MockSignInWithAppleProvider()]))

AccountSetup()
.previewWith {
AccountConfiguration(building: detailsBuilder, active: MockUserIdPasswordAccountService())
Expand Down

0 comments on commit 2de0720

Please sign in to comment.