Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ final class GoogleAuthenticationService: AuthenticationService {
try await GIDSignIn.sharedInstance.disconnect()
}

@MainActor
func link(uid: String, email: String) async throws {
let topViewController = await MainActor.run {
provider.topViewController()
}
guard let topViewController = topViewController else {
guard let topViewController = provider.topViewController() else {
throw UIError.notFoundTopViewController
}

Expand Down
8 changes: 4 additions & 4 deletions DevLog/Presentation/ViewModel/AccountViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ final class AccountViewModel: Store {
effects = [.link(value)]
case .unlinkFromProvider(let value):
effects = [.unlink(value)]
case .setAlert(let isPresented, let type):
setAlert(&state, isPresented: isPresented, type: type)
case .setToast(let isPresented, let type):
setToast(&state, isPresented: isPresented, type: type)
case .setAlert(let presented, let type):
setAlert(&state, isPresented: presented, type: type)
case .setToast(let presented, let type):
setToast(&state, isPresented: presented, type: type)
Comment thread
opficdev marked this conversation as resolved.
case .setLoading(let value):
state.isLoading = value
case .updateProviders(let currentProvider, let allProviders):
Expand Down
6 changes: 6 additions & 0 deletions DevLog/UI/Setting/AccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ struct AccountView: View {
} message: {
Text(viewModel.state.alertMessage)
}
.toast(isPresented: Binding(
get: { viewModel.state.showToast },
set: { viewModel.send(.setToast(isPresented: $0)) }
)) {
Text(viewModel.state.toastMessage)
}
.overlay {
if viewModel.state.isLoading {
LoadingView()
Expand Down
Loading