marinofaggiana 3 жил өмнө
parent
commit
e8cb9e5b8a

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -870,13 +870,13 @@
 				F7DFB7E9219C5A0500680748 /* Create cloud */,
 				F78ACD50219046AC0088454D /* Section Header Footer */,
 				F7603298252F0E550015A421 /* Collection Common */,
+				F7CA213725F1372B00826ABB /* Account Request */,
 				370D26AE248A3D7A00121797 /* NCCellProtocol.swift */,
 				F7226EDB1EE4089300EBECB1 /* Main.storyboard */,
 				F7682FDF23C36B0500983A04 /* NCMainTabBar.swift */,
 				F729289F253B0937009CA4FD /* NCMainNavigationController.swift */,
 				F75B0ABC244C4DBB00E58DCA /* NCFunctionCenter.swift */,
 				F77444F7222816D5000D5EB0 /* NCPickerViewController.swift */,
-				F7CA213725F1372B00826ABB /* Account Request */,
 			);
 			path = Main;
 			sourceTree = "<group>";

+ 22 - 0
iOSClient/Menu/NCLoginWeb+Menu.swift

@@ -64,6 +64,28 @@ extension NCLoginWeb {
                 )
             )
         }
+        
+        actions.append(
+            NCMenuAction(
+                title: NSLocalizedString("_delete_active_account_", comment: ""),
+                icon: NCUtility.shared.loadImage(named: "trash", color: NCBrandColor.shared.gray),
+                onTitle: NSLocalizedString("_delete_active_account_", comment: ""),
+                onIcon: avatar,
+                selected: false,
+                on: false,
+                action: { menuAction in
+                    self.appDelegate.deleteAccount(self.appDelegate.account, wipe: false)
+                    self.dismiss(animated: true) {
+                        let accounts = NCManageDatabase.shared.getAllAccount()
+                        if accounts.count > 0 {
+                            self.appDelegate.changeAccount(accounts.first!.account)
+                        } else {
+                            self.appDelegate.openLogin(viewController: nil, selector: NCGlobal.shared.introLogin, openLoginWeb: false)
+                        }
+                    }
+                }
+            )
+        )
        
         menuViewController.actions = actions
 

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -294,6 +294,7 @@
 "_change_password_"             = "Change password";
 "_add_account_"                 = "Add account";
 "_delete_account_"              = "Remove account";
+"_delete_active_account_"       = "Remove active account";
 "_want_delete_"                 = "Do you really want to delete?";
 "_no_delete_"                   = "No, do not delete";
 "_yes_delete_"                  = "Yes, delete";