@@ -60,8 +60,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
6060
6161 NCBrandColor . shared. createUserColors ( )
6262
63+ // Setup Networking
64+ //
6365 NextcloudKit . shared. setup ( groupIdentifier: NCBrandOptions . shared. capabilitiesGroup,
6466 delegate: NCNetworking . shared)
67+ NCNetworking . shared. setupTransferDelegate ( )
6568
6669 NextcloudKit . configureLogger ( logLevel: ( NCBrandOptions . shared. disable_log ? . disabled : NCPreferences ( ) . log) )
6770
@@ -421,7 +424,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
421424 if let controller = SceneManager . shared. getControllers ( ) . first ( where: { $0. account == account } ) {
422425 openNotification ( controller: controller)
423426 } else if let tblAccount = NCManageDatabase . shared. getAllTableAccount ( ) . first ( where: { $0. account == account } ) ,
424- let controller = UIApplication . shared. firstWindow ? . rootViewController as? NCMainTabBarController {
427+ let controller = UIApplication . shared. mainAppWindow ? . rootViewController as? NCMainTabBarController {
425428 Task { @MainActor in
426429 await NCAccount ( ) . changeAccount ( tblAccount. account, userProfile: nil , controller: controller)
427430 openNotification ( controller: controller)
@@ -430,7 +433,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
430433 let message = NSLocalizedString ( " _the_account_ " , comment: " " ) + " " + account + " " + NSLocalizedString( " _does_not_exist_ " , comment: " " )
431434 let alertController = UIAlertController ( title: NSLocalizedString ( " _info_ " , comment: " " ) , message: message, preferredStyle: . alert)
432435 alertController. addAction ( UIAlertAction ( title: NSLocalizedString ( " _ok_ " , comment: " " ) , style: . default, handler: { _ in } ) )
433- UIApplication . shared. firstWindow ? . rootViewController? . present ( alertController, animated: true , completion: { } )
436+ UIApplication . shared. mainAppWindow ? . rootViewController? . present ( alertController, animated: true , completion: { } )
434437 }
435438 }
436439
@@ -463,11 +466,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
463466 let viewController = navigationController. topViewController as? NCViewCertificateDetails {
464467 viewController. delegate = self
465468 viewController. host = host
466- UIApplication . shared. firstWindow ? . rootViewController? . present ( navigationController, animated: true )
469+ UIApplication . shared. mainAppWindow ? . rootViewController? . present ( navigationController, animated: true )
467470 }
468471 } ) )
469472
470- UIApplication . shared. firstWindow ? . rootViewController? . present ( alertController, animated: true )
473+ UIApplication . shared. mainAppWindow ? . rootViewController? . present ( alertController, animated: true )
471474 }
472475
473476 // MARK: - Reset Application
0 commit comments