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 bb435b2
Show file tree
Hide file tree
Showing 3 changed files with 7 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
2 changes: 2 additions & 0 deletions Apps/LekaApp/Sources/Views/MainView/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ struct MainView: View {
self.styleManager.colorScheme = self.caregiverManagerViewModel.currentCaregiver!.colorScheme
self.styleManager.accentColor = self.caregiverManagerViewModel.currentCaregiver!.colorTheme.color
}
self.libraryManager.initializeLibraryListener()
}
}

Expand All @@ -401,6 +402,7 @@ struct MainView: View {
private var persistentDataManager: PersistentDataManager = .shared
private var caregiverManager: CaregiverManager = .shared
private var carereceiverManager: CarereceiverManager = .shared
private var libraryManager: LibraryManager = .shared
}

// swiftlint:enable type_body_length
Expand Down

0 comments on commit bb435b2

Please sign in to comment.