Skip to content

Commit 5614f14

Browse files
chore: fix compiler errors and remove reportError from user code
1 parent 8b2c906 commit 5614f14

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ extension AuthPickerView: View {
3636
public var body: some View {
3737
@Bindable var authService = authService
3838
content()
39-
.environment(\.reportError, reportError)
4039
.sheet(isPresented: $authService.isPresented) {
4140
@Bindable var navigator = authService.navigator
4241
NavigationStack(path: $navigator.routes) {

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EmailAuthView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public struct EmailAuthView {
5050
}
5151
}
5252

53-
private func signInWithEmailPassword() async {
53+
private func signInWithEmailPassword() async throws {
5454
do {
5555
_ = try await authService.signIn(email: email, password: password)
5656
} catch {
@@ -62,7 +62,7 @@ public struct EmailAuthView {
6262
}
6363
}
6464

65-
private func createUserWithEmailPassword() async {
65+
private func createUserWithEmailPassword() async throws {
6666
do {
6767
_ = try await authService.createUser(email: email, password: password)
6868
} catch {
@@ -100,7 +100,7 @@ extension EmailAuthView: View {
100100
contentType: .password,
101101
sensitive: true,
102102
onSubmit: { _ in
103-
Task { await signInWithEmailPassword() }
103+
Task { try await signInWithEmailPassword() }
104104
},
105105
leading: {
106106
Image(systemName: "lock")
@@ -127,7 +127,7 @@ extension EmailAuthView: View {
127127
contentType: .password,
128128
sensitive: true,
129129
onSubmit: { _ in
130-
Task { await createUserWithEmailPassword() }
130+
Task { try await createUserWithEmailPassword() }
131131
},
132132
leading: {
133133
Image(systemName: "lock")
@@ -141,9 +141,9 @@ extension EmailAuthView: View {
141141
Button(action: {
142142
Task {
143143
if authService.authenticationFlow == .signIn {
144-
await signInWithEmailPassword()
144+
try await signInWithEmailPassword()
145145
} else {
146-
await createUserWithEmailPassword()
146+
try await createUserWithEmailPassword()
147147
}
148148
}
149149
}) {

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EmailLinkView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public struct EmailLinkView {
2525

2626
public init() {}
2727

28-
private func sendEmailLink() async {
28+
private func sendEmailLink() async throws {
2929
do {
3030
try await authService.sendEmailSignInLink(email: email)
3131
showModal = true
@@ -54,7 +54,7 @@ extension EmailLinkView: View {
5454
)
5555
Button {
5656
Task {
57-
await sendEmailLink()
57+
try await sendEmailLink()
5858
authService.emailLink = email
5959
}
6060
} label: {

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/SignedInView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct SignedInView {
2222
@State private var showDeleteConfirmation = false
2323
@State private var showEmailVerificationSent = false
2424

25-
private func sendEmailVerification() async {
25+
private func sendEmailVerification() async throws {
2626
do {
2727
try await authService.sendEmailVerification()
2828
showEmailVerificationSent = true
@@ -51,7 +51,7 @@ extension SignedInView: View {
5151
if authService.currentUser?.isEmailVerified == false {
5252
Button {
5353
Task {
54-
await sendEmailVerification()
54+
try await sendEmailVerification()
5555
}
5656
} label: {
5757
Text(authService.string.sendEmailVerificationButtonLabel)

0 commit comments

Comments
 (0)