Skip to content

Commit

Permalink
chore: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rnr committed Jan 13, 2025
1 parent 98b15b7 commit bc68e64
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import OEXFoundation
public enum AuthMethod: Equatable {
case password
case SSO
case socailAuth(SocialAuthMethod)
case socialAuth(SocialAuthMethod)

public var analyticsValue: String {
switch self {
case .password:
"password"
case .SSO:
"SSO"
case .socailAuth(let socialAuthMethod):
case .socialAuth(let socialAuthMethod):
socialAuthMethod.rawValue
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public class SignInViewModel: ObservableObject {
analytics.identify(id: "\(user.id)", username: user.username, email: user.email)
analytics.userLogin(method: authMethod)
var postLoginData: PostLoginData?
if case .socailAuth(let socialMethod) = authMethod {
if case .socialAuth(let socialMethod) = authMethod {
postLoginData = PostLoginData(authMethod: socialMethod.rawValue, showSocialRegisterBanner: false)
}
router.showMainOrWhatsNewScreen(sourceScreen: sourceScreen, postLoginData: postLoginData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public final class SignUpViewModel: ObservableObject {
analytics.registrationSuccess(method: authMetod.analyticsValue)
isShowProgress = false
var postLoginData: PostLoginData?
if case .socailAuth(let socialMethod) = authMethod {
if case .socialAuth(let socialMethod) = authMethod {
postLoginData = PostLoginData(authMethod: socialMethod.rawValue, showSocialRegisterBanner: false)
}
router.showMainOrWhatsNewScreen(sourceScreen: sourceScreen, postLoginData: postLoginData)
Expand Down Expand Up @@ -202,7 +202,7 @@ public final class SignUpViewModel: ObservableObject {
analytics.userLogin(method: authMethod)
isShowProgress = false
var postLoginData: PostLoginData?
if case .socailAuth(let socialMethod) = authMethod {
if case .socialAuth(let socialMethod) = authMethod {
postLoginData = PostLoginData(authMethod: socialMethod.rawValue, showSocialRegisterBanner: true)
}
router.showMainOrWhatsNewScreen(sourceScreen: sourceScreen, postLoginData: postLoginData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ enum SocialAuthDetails {
var authMethod: AuthMethod {
switch self {
case .apple:
.socailAuth(.apple)
.socialAuth(.apple)
case .facebook:
.socailAuth(.facebook)
.socialAuth(.facebook)
case .google:
.socailAuth(.google)
.socialAuth(.google)
case .microsoft:
.socailAuth(.microsoft)
.socialAuth(.microsoft)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ final class SignInViewModelTests: XCTestCase {
.apple(.init(name: "name", email: "email", token: "239i2oi3jrf2jflkj23lf2f"))
)
let validationErrorMessage = AuthLocalization.Error.accountNotRegistered(
AuthMethod.socailAuth(.apple).analyticsValue,
AuthMethod.socialAuth(.apple).analyticsValue,
viewModel.config.platformName
)
let validationError = CustomValidationError(statusCode: 400, data: ["error_description": validationErrorMessage])
Expand Down
8 changes: 3 additions & 5 deletions Core/Core/View/Base/LogistrationBottomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ public enum LogistrationAction: Sendable {
}

public struct PostLoginData: Sendable {
public var authMethod: String = ""
public var showSocialRegisterBanner: Bool = false
public let authMethod: String
public var showSocialRegisterBanner: Bool

public init(authMethod: String, showSocialRegisterBanner: Bool) {
public init(authMethod: String = "", showSocialRegisterBanner: Bool = false) {
self.authMethod = authMethod
self.showSocialRegisterBanner = showSocialRegisterBanner
}

public init() {}
}

public struct LogistrationBottomView: View {
Expand Down

0 comments on commit bc68e64

Please sign in to comment.