Multiplatform: activate the app so users can see the results of their actions.
This commit is contained in:
parent
67d80dbaec
commit
056aadec14
@ -277,8 +277,14 @@ extension AddAccountModel {
|
|||||||
// MARK:- OAuthAccountAuthorizationOperationDelegate
|
// MARK:- OAuthAccountAuthorizationOperationDelegate
|
||||||
extension AddAccountModel: OAuthAccountAuthorizationOperationDelegate {
|
extension AddAccountModel: OAuthAccountAuthorizationOperationDelegate {
|
||||||
func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didCreate account: Account) {
|
func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didCreate account: Account) {
|
||||||
|
|
||||||
accountIsAuthenticating = false
|
accountIsAuthenticating = false
|
||||||
accountAdded = true
|
accountAdded = true
|
||||||
|
|
||||||
|
// macOS only: `ASWebAuthenticationSession` leaves the browser in the foreground.
|
||||||
|
// Ensure the app is in the foreground so the user can see their Feedly account load.
|
||||||
|
NSApplication.shared.activate(ignoringOtherApps: true)
|
||||||
|
|
||||||
account.refreshAll { [weak self] result in
|
account.refreshAll { [weak self] result in
|
||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
@ -291,6 +297,11 @@ extension AddAccountModel: OAuthAccountAuthorizationOperationDelegate {
|
|||||||
|
|
||||||
func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didFailWith error: Error) {
|
func oauthAccountAuthorizationOperation(_ operation: OAuthAccountAuthorizationOperation, didFailWith error: Error) {
|
||||||
accountIsAuthenticating = false
|
accountIsAuthenticating = false
|
||||||
|
|
||||||
|
// macOS only: `ASWebAuthenticationSession` leaves the browser in the foreground.
|
||||||
|
// Ensure the app is in the foreground so the user can see the error.
|
||||||
|
NSApplication.shared.activate(ignoringOtherApps: true)
|
||||||
|
|
||||||
addAccountError = .other(error: error)
|
addAccountError = .other(error: error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user