Minor cleanup
This commit is contained in:
parent
f123be046c
commit
71b2146862
@ -49,33 +49,26 @@ open class ActionOpenPageHandler: MVMCoreActionHandlerProtocol {
|
||||
}
|
||||
|
||||
public extension ClientParameterHandler {
|
||||
|
||||
/// Iterates through the clientParameters list. Gets values from the individual handlers and attaches the parameters to extraParameters.
|
||||
func getClientParameters(with model: ClientParameterModel, requestParameters: [String: Any], showLoadingOverlay: Bool) async throws -> [String: Any]? {
|
||||
|
||||
if showLoadingOverlay {
|
||||
MVMCoreLoadingOverlayHandler.sharedLoadingOverlay()?.startLoading()
|
||||
}
|
||||
|
||||
do {
|
||||
let parameters: [String: Any]? = try await withCheckedThrowingContinuation({ continuation in
|
||||
do {
|
||||
try getParameters(with: model, requestParameters: requestParameters) { parameters in
|
||||
MVMCoreLoadingOverlayHandler.sharedLoadingOverlay()?.stopLoading(true)
|
||||
continuation.resume(returning: parameters)
|
||||
}
|
||||
} catch {
|
||||
continuation.resume(throwing: error)
|
||||
}
|
||||
})
|
||||
defer {
|
||||
if showLoadingOverlay {
|
||||
MVMCoreLoadingOverlayHandler.sharedLoadingOverlay()?.stopLoading(true)
|
||||
}
|
||||
return parameters
|
||||
} catch {
|
||||
if showLoadingOverlay {
|
||||
MVMCoreLoadingOverlayHandler.sharedLoadingOverlay()?.stopLoading(true)
|
||||
}
|
||||
throw error
|
||||
}
|
||||
return try await withCheckedThrowingContinuation({ continuation in
|
||||
do {
|
||||
try getParameters(with: model, requestParameters: requestParameters) { parameters in
|
||||
MVMCoreLoadingOverlayHandler.sharedLoadingOverlay()?.stopLoading(true)
|
||||
continuation.resume(returning: parameters)
|
||||
}
|
||||
} catch {
|
||||
continuation.resume(throwing: error)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user