Skip to content

Commit

Permalink
fix: stream service like OpenAI trigger multi Alert issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phlpsong committed Feb 7, 2024
1 parent 82e6961 commit 5b5f79f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ struct ServiceConfigurationSecretSectionView<Content: View>: View {
viewModel.isValidating.toggle()
service.validate { _, error in
DispatchQueue.main.async {
service.result.isFinished = true
guard !viewModel.isAlertPresented else { return }
viewModel.alertMessage = error == nil ? "service.configuration.validation_success" : "service.configuration.validation_fail"
print("\(service.serviceType()) validate \(error == nil ? "success" : "fail")!")
viewModel.isValidating.toggle()
Expand Down

0 comments on commit 5b5f79f

Please sign in to comment.