Skip to content

Commit

Permalink
✨ (LekaApp): Create Library on Signup, SignIn & when missing
Browse files Browse the repository at this point in the history
  • Loading branch information
macteuts committed Dec 20, 2024
1 parent 4645909 commit 24aa011
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct AccountCreationView: View {
if newValue == .loggedIn {
self.rootAccountManager.createRootAccount(rootAccount: RootAccount())
self.rootAccountManager.initializeRootAccountListener()
self.libraryManager.createLibrary(library: Library())
self.libraryManager.initializeLibraryListener()
self.isVerificationEmailAlertPresented = true
}
}
Expand Down Expand Up @@ -84,6 +86,7 @@ struct AccountCreationView: View {

private var authManager = AuthManager.shared
private var rootAccountManager = RootAccountManager.shared
private var libraryManager = LibraryManager.shared

private var isCreationDisabled: Bool {
self.viewModel.email.isInvalidEmail() || self.viewModel.password.isInvalidPassword()
Expand Down
2 changes: 2 additions & 0 deletions Apps/LekaApp/Sources/Views/ConnectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct ConnectionView: View {
self.caregiverManager.initializeCaregiversListener()
self.carereceiverManager.initializeCarereceiversListener()
self.rootAccountManager.initializeRootAccountListener()
self.libraryManager.initializeLibraryListener()
AnalyticsManager.logEventLogin()
self.authManagerViewModel.userAction = .none
self.navigation.fullScreenCoverContent = nil
Expand All @@ -103,6 +104,7 @@ struct ConnectionView: View {

private var authManager: AuthManager = .shared
private var rootAccountManager: RootAccountManager = .shared
private var libraryManager: LibraryManager = .shared
private var caregiverManager: CaregiverManager = .shared
private var carereceiverManager: CarereceiverManager = .shared

Expand Down
1 change: 1 addition & 0 deletions Apps/LekaApp/Sources/Views/MainView/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ struct MainView: View {

@StateObject private var caregiverManagerViewModel = CaregiverManagerViewModel()
@StateObject private var rootAccountViewModel = RootAccountManagerViewModel()
@StateObject private var libraryManagerViewModel = LibraryManagerViewModel()

@State private var showingAppUpdateAlert: Bool = false
@State private var showingOSUpdateAlert: Bool = false
Expand Down

0 comments on commit 24aa011

Please sign in to comment.