Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mathieu/feature/Manage RootAccount creation during signup #737

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ struct AccountCreationView: View {
}
.onChange(of: self.authManagerViewModel.userAuthenticationState) { newValue in
if newValue == .loggedIn {
self.rootAccountManager.createRootAccount(rootAccount: RootAccount())
self.authManagerViewModel.userIsSigningUp = true
self.isVerificationEmailAlertPresented = true
} else {
// display signup failed alert
}
}
.alert(isPresented: self.$isVerificationEmailAlertPresented) {
Expand All @@ -71,6 +70,7 @@ struct AccountCreationView: View {
@StateObject private var viewModel = AccountCreationViewViewModel()
@ObservedObject private var authManagerViewModel = AuthManagerViewModel.shared
private var authManager = AuthManager.shared
private var rootAccountManager = RootAccountManager.shared

private var isCreationDisabled: Bool {
self.viewModel.email.isInvalidEmail() || self.viewModel.password.isInvalidPassword()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import SwiftUI

public extension RootAccount {
init(id: String? = "",
rootOwnerUid: String = "")
{
self.id = id
self.rootOwnerUid = rootOwnerUid
}
}
Loading