From d80d2592959aa6137bb6b6a5ce349f1e20be617e Mon Sep 17 00:00:00 2001 From: NiraliSonani Date: Mon, 16 Dec 2024 13:10:20 +0530 Subject: [PATCH] Changed alert --- Data/Data/Repository/UserRepository.swift | 2 +- Splito/UI/Login/EmailLogin/EmailLoginViewModel.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/Data/Repository/UserRepository.swift b/Data/Data/Repository/UserRepository.swift index 3e50c76fc..01fd5204e 100644 --- a/Data/Data/Repository/UserRepository.swift +++ b/Data/Data/Repository/UserRepository.swift @@ -31,7 +31,7 @@ public class UserRepository: ObservableObject { public func fetchUserBy(userID: String) async throws -> AppUser? { return try await store.fetchUserBy(id: userID) } - + public func fetchUserBy(email: String) async throws -> AppUser? { return try await store.fetchUserBy(email: email) } diff --git a/Splito/UI/Login/EmailLogin/EmailLoginViewModel.swift b/Splito/UI/Login/EmailLogin/EmailLoginViewModel.swift index 6a2c07f3c..5a4cbf758 100644 --- a/Splito/UI/Login/EmailLogin/EmailLoginViewModel.swift +++ b/Splito/UI/Login/EmailLogin/EmailLoginViewModel.swift @@ -50,7 +50,7 @@ public class EmailLoginViewModel: BaseViewModel, ObservableObject { if let user = try await userRepository.fetchUserBy(email: email) { if user.loginType != .Email { isLoginInProgress = false - showAlertFor(title: "Error", message: "This account already exists with a different login method.") + showAlertFor(title: "Email Already in Use", message: "The email address is already associated with an existing account. Please use a different email or log in to your existing account.") return }