Fix PR remarks

This commit is contained in:
ismailgulek 2022-06-07 19:48:26 +03:00
parent bb333c1d31
commit fc29e4be51
No known key found for this signature in database
GPG key ID: E96336D42D9470A9
3 changed files with 17 additions and 2 deletions

View file

@ -17,6 +17,7 @@
*/
import UIKit
import CommonKit
struct AuthenticationCoordinatorParameters {
let navigationRouter: NavigationRouterType
@ -59,6 +60,9 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc
/// The listener object that informs the coordinator whether verification needs to be presented or not.
private var verificationListener: SessionVerificationListener?
private var indicatorPresenter: UserIndicatorTypePresenterProtocol
private var successIndicator: UserIndicator?
/// The password entered, for use when setting up cross-signing.
private var password: String?
@ -77,6 +81,8 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc
self.navigationRouter = parameters.navigationRouter
self.initialScreen = parameters.initialScreen
self.canPresentAdditionalScreens = parameters.canPresentAdditionalScreens
indicatorPresenter = UserIndicatorTypePresenter(presentingViewController: parameters.navigationRouter.toPresentable())
super.init()
}
@ -615,7 +621,12 @@ extension AuthenticationCoordinator: AuthenticationServiceDelegate {
}
func authenticationService(_ service: AuthenticationService, didUpdateStateWithLink link: UniversalLink) {
// updating current views according to the link doesn't seem easy.
if link.pathParams.first == "register" {
callback?(.cancel(.register))
} else {
callback?(.cancel(.login))
}
successIndicator = indicatorPresenter.present(.success(label: VectorL10n.done))
}
}

View file

@ -109,7 +109,10 @@
queryParams[key] = [NSMutableArray array];
}
[queryParams[key] addObject:value];
if (![queryParams[key] containsObject:value])
{
[queryParams[key] addObject:value];
}
}
else
{

View file

@ -97,6 +97,7 @@ class AuthenticationService: NSObject {
let flow: AuthenticationFlow = isRegister ? .register : .login
if needsAuthentication {
reset()
// not logged in
// update the state with given HS and IS addresses
state = AuthenticationState(flow: flow,