From bb4fbb5872846990c79cde42485fa0893c266b02 Mon Sep 17 00:00:00 2001 From: "mathieu J." Date: Wed, 18 Dec 2024 18:29:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(LekaApp):=20Create=20Library=20on?= =?UTF-8?q?=20Signup=20and=20when=20missing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Views/AccountCreation/AccountCreationView.swift | 3 +++ Apps/LekaApp/Sources/Views/MainView/MainView.swift | 1 + 2 files changed, 4 insertions(+) diff --git a/Apps/LekaApp/Sources/Views/AccountCreation/AccountCreationView.swift b/Apps/LekaApp/Sources/Views/AccountCreation/AccountCreationView.swift index 0da55b9b2..7fe78abb0 100644 --- a/Apps/LekaApp/Sources/Views/AccountCreation/AccountCreationView.swift +++ b/Apps/LekaApp/Sources/Views/AccountCreation/AccountCreationView.swift @@ -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 } } @@ -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() diff --git a/Apps/LekaApp/Sources/Views/MainView/MainView.swift b/Apps/LekaApp/Sources/Views/MainView/MainView.swift index 43d1f1c30..d064cb891 100644 --- a/Apps/LekaApp/Sources/Views/MainView/MainView.swift +++ b/Apps/LekaApp/Sources/Views/MainView/MainView.swift @@ -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