Adds Error Display for the handle(_: URL) function

Additionally, shortens validation code in AddAccount
This commit is contained in:
Stuart Breckenridge
2022-12-21 21:01:58 +08:00
parent 12b17e3f36
commit 7dc5845f4e
3 changed files with 12 additions and 15 deletions

View File

@@ -13,9 +13,10 @@ import OAuthSwift
import Secrets
import RSCore
@MainActor
public final class EnableExtensionViewModel: NSObject, ObservableObject, OAuthSwiftURLHandlerType, ASWebAuthenticationPresentationContextProviding, Logging {
@Published public var showExtensionError: (Error?, Bool) = (nil, false)
private var extensionPointType: ExtensionPoint.Type?
private var oauth: OAuthSwift?
private var callbackURL: URL? = nil
@@ -146,7 +147,7 @@ public final class EnableExtensionViewModel: NSObject, ObservableObject, OAuthSw
if case ASWebAuthenticationSessionError.canceledLogin = error {
print("Login cancelled.")
} else {
//self.presentError(error)
self.showExtensionError = (error, true)
}
})