Skip to content

Commit

Permalink
Fixed error state for Service and Credential Selection when RQESServi…
Browse files Browse the repository at this point in the history
…ce returns error
  • Loading branch information
stzouvaras committed Dec 3, 2024
1 parent 3b419a2 commit dddf55c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ final class CredentialSelectionViewModel<Router: RouterGraph>: ViewModel<Router,
}

func nextStep() {
onPause()
openAuthorization()
}

func openAuthorization() {
Task {
do {

let authorizationUrl = try await interactor.openCredentialAuthrorizationURL()
self.onPause()

await UIApplication.shared.openURLIfPossible(authorizationUrl) {
self.setErrorState {
self.setState { $0.copy(error: nil) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class ServiceSelectionViewModel<Router: RouterGraph>: ViewModel<Router, ServiceS
}

func nextStep() {
onPause()
openAuthorization()
}

Expand All @@ -82,7 +81,9 @@ class ServiceSelectionViewModel<Router: RouterGraph>: ViewModel<Router, ServiceS
self.setState { $0.copy(error: nil) }
}
}

let authorizationUrl = try await interactor.openAuthrorizationURL()
self.onPause()

await UIApplication.shared.openURLIfPossible(authorizationUrl) {
self.setErrorState {
Expand Down

0 comments on commit dddf55c

Please sign in to comment.