Skip to content

Commit

Permalink
🔀 Merge branch 'hugo/feature/Rename-RootAccount'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Feb 12, 2024
2 parents a298ea3 + 41dcdfa commit e3a45b3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
8 changes: 0 additions & 8 deletions Apps/LekaApp/Sources/_NEWCodeBase/Models/CompanyModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ import AccountKit
import DesignKit
import SwiftUI

// MARK: - Company

struct Company: Identifiable {
var id = UUID().uuidString
var email: String
var password: String
}

// MARK: - Profile

// Profiles types base-protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ struct AccountCreationView: View {
.onChange(of: self.authManagerViewModel.userAuthenticationState) { newValue in
if newValue == .loggedIn {
self.authManagerViewModel.userIsSigningUp = true
self.rootOwnerViewModel.currentCompany = Company(
email: self.viewModel.email,
password: self.viewModel.password
)
self.viewModel.navigateToAccountCreationProcess.toggle()
} else {
// display signup failed alert
Expand All @@ -65,7 +61,6 @@ struct AccountCreationView: View {
// MARK: Private

@StateObject private var viewModel = AccountCreationViewViewModel()
@ObservedObject private var rootOwnerViewModel = RootOwnerViewModel.shared
@ObservedObject private var authManagerViewModel = AuthManagerViewModel.shared
private var authManager = AuthManager.shared

Expand Down
4 changes: 0 additions & 4 deletions Apps/LekaApp/Sources/_NEWCodeBase/Views/ConnectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ struct ConnectionView: View {
}
.onChange(of: self.authManagerViewModel.userAuthenticationState) { newValue in
if newValue == .loggedIn {
self.rootOwnerViewModel.currentCompany = Company(
email: self.viewModel.email,
password: self.viewModel.password
)
self.viewModel.navigateToCaregiverSelection.toggle()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class RootOwnerViewModel: ObservableObject {

static let shared = RootOwnerViewModel()

@Published var currentCompany: Company?
@Published var currentCaregiver: Caregiver?
@Published var currentCarereceiver: Carereceiver?

Expand Down Expand Up @@ -67,7 +66,6 @@ class RootOwnerViewModel: ObservableObject {
}

func disconnect() {
self.currentCompany = nil
self.currentCaregiver = nil
self.currentCarereceiver = nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ extension SettingsView {
var body: some View {
Section(String(l10n.SettingsView.CredentialsSection.header.characters)) {
LabeledContent {
Text(self.rootOwnerViewModel.currentCompany?.email ?? "")
// TODO: (@mathieu) - Add mail info with Firebase/store
Text("[email protected]")
.font(.footnote)
.multilineTextAlignment(.leading)
} label: {
Expand Down
14 changes: 14 additions & 0 deletions Modules/AccountKit/Sources/Models/RootAccount.swift
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

// MARK: - RootAccount

struct RootAccount: Identifiable, Codable {
var id: String
var rootOwnerUid: String
var createdAt: Date
var lastEditedAt: Date
}

0 comments on commit e3a45b3

Please sign in to comment.