Skip to content

Commit 3a90dff

Browse files
refactor: error modal pop-up handled in View layer
1 parent 4661345 commit 3a90dff

13 files changed

Lines changed: 378 additions & 395 deletions

File tree

FirebaseSwiftUI/FirebaseAppleSwiftUI/Sources/Views/SignInWithAppleButton.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import SwiftUI
2020
@MainActor
2121
public struct SignInWithAppleButton {
2222
@Environment(AuthService.self) private var authService
23+
@Environment(\.reportError) private var reportError
2324
let provider: AuthProviderSwift
2425
public init(provider: AuthProviderSwift) {
2526
self.provider = provider
@@ -34,7 +35,11 @@ extension SignInWithAppleButton: View {
3435
accessibilityId: "sign-in-with-apple-button"
3536
) {
3637
Task {
37-
try? await authService.signIn(provider)
38+
do {
39+
_ = try await authService.signIn(provider)
40+
} catch let caughtError {
41+
reportError(caughtError)
42+
}
3843
}
3944
}
4045
}

0 commit comments

Comments
 (0)