Răsfoiți Sursa

Version 5.3.1 (#2935)

Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 10 luni în urmă
părinte
comite
6ebaf7e137

+ 4 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -5264,7 +5264,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 21;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -5290,7 +5290,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 					"@executable_path/../../Frameworks",
 				);
 				);
-				MARKETING_VERSION = 5.3.0;
+				MARKETING_VERSION = 5.3.1;
 				ONLY_ACTIVE_ARCH = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = "-v";
 				OTHER_CFLAGS = "-v";
 				OTHER_LDFLAGS = "";
 				OTHER_LDFLAGS = "";
@@ -5330,7 +5330,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 21;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
 				ENABLE_TESTABILITY = YES;
@@ -5353,7 +5353,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 					"@executable_path/../../Frameworks",
 				);
 				);
-				MARKETING_VERSION = 5.3.0;
+				MARKETING_VERSION = 5.3.1;
 				ONLY_ACTIVE_ARCH = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = "-v";
 				OTHER_CFLAGS = "-v";
 				OTHER_LDFLAGS = "";
 				OTHER_LDFLAGS = "";

+ 1 - 0
iOSClient/Extensions/Array+Extension.swift

@@ -23,6 +23,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 // https://stackoverflow.com/questions/33861036/unique-objects-inside-a-array-swift/45023247#45023247
 // https://stackoverflow.com/questions/33861036/unique-objects-inside-a-array-swift/45023247#45023247
 extension Array {
 extension Array {

+ 1 - 0
iOSClient/Extensions/Data+Extension.swift

@@ -22,6 +22,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension Data {
 extension Data {
 
 

+ 1 - 0
iOSClient/Extensions/DateFormatter+Extension.swift

@@ -22,6 +22,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension DateFormatter {
 extension DateFormatter {
     static let shareExpDate: DateFormatter = {
     static let shareExpDate: DateFormatter = {

+ 1 - 0
iOSClient/Extensions/Optional+Extension.swift

@@ -22,6 +22,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension Optional where Wrapped: Collection {
 extension Optional where Wrapped: Collection {
     var isEmptyOrNil: Bool {
     var isEmptyOrNil: Bool {

+ 1 - 0
iOSClient/Extensions/UIAlertController+Extension.swift

@@ -21,6 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 //
 
 
+import Foundation
 import UIKit
 import UIKit
 import NextcloudKit
 import NextcloudKit
 
 

+ 1 - 0
iOSClient/Extensions/UIApplication+Extension.swift

@@ -7,6 +7,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension UIApplication {
 extension UIApplication {
     var firstWindow: UIWindow? {
     var firstWindow: UIWindow? {

+ 1 - 0
iOSClient/Extensions/UIBarButton+Extension.swift

@@ -22,6 +22,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 //
 
 
+import Foundation
 import UIKit
 import UIKit
 
 
 private var actionKey: Void?
 private var actionKey: Void?

+ 1 - 0
iOSClient/Extensions/UIControl+Extension.swift

@@ -23,6 +23,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 public class ActionClosure {
 public class ActionClosure {
 
 

+ 1 - 0
iOSClient/Extensions/UIDevice+Extension.swift

@@ -22,6 +22,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension UIDevice {
 extension UIDevice {
 
 

+ 1 - 0
iOSClient/Extensions/UIFont+Extension.swift

@@ -21,6 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 //
 
 
+import Foundation
 import UIKit
 import UIKit
 
 
 extension UIFont {
 extension UIFont {

+ 1 - 0
iOSClient/Extensions/UILabel+Extension.swift

@@ -21,6 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 //
 
 
+import Foundation
 import UIKit
 import UIKit
 
 
 //
 //

+ 1 - 0
iOSClient/Extensions/UINavigationController+Extension.swift

@@ -22,6 +22,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension UINavigationController {
 extension UINavigationController {
 
 

+ 1 - 0
iOSClient/Extensions/UITabBarController+Extension.swift

@@ -22,6 +22,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension UITabBarController {
 extension UITabBarController {
 
 

+ 1 - 0
iOSClient/Extensions/UIToolbar+Extension.swift

@@ -21,6 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 //
 
 
+import Foundation
 import UIKit
 import UIKit
 
 
 extension UIToolbar {
 extension UIToolbar {

+ 1 - 0
iOSClient/Extensions/UIViewController+Extension.swift

@@ -22,6 +22,7 @@
 //
 //
 
 
 import Foundation
 import Foundation
+import UIKit
 
 
 extension UIViewController {
 extension UIViewController {
 
 

+ 13 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon+SelectTabBarDelegate.swift

@@ -21,6 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 //
 
 
+import UIKit
 import Foundation
 import Foundation
 import NextcloudKit
 import NextcloudKit
 
 
@@ -161,7 +162,7 @@ extension NCCollectionViewCommon: NCCollectionViewCommonSelectTabBarDelegate {
     func saveLayout(_ layoutForView: NCDBLayoutForView) {
     func saveLayout(_ layoutForView: NCDBLayoutForView) {
         NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView)
         NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView)
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource)
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource)
-        setNavigationRightItems(enableMenu: false)
+        setNavigationRightItems()
     }
     }
 
 
     func getSelectedMetadatas() -> [tableMetadata] {
     func getSelectedMetadatas() -> [tableMetadata] {
@@ -176,7 +177,17 @@ extension NCCollectionViewCommon: NCCollectionViewCommonSelectTabBarDelegate {
     func setEditMode(_ editMode: Bool) {
     func setEditMode(_ editMode: Bool) {
         isEditMode = editMode
         isEditMode = editMode
         selectOcId.removeAll()
         selectOcId.removeAll()
-        setNavigationRightItems(enableMenu: !editMode)
+
+        if editMode {
+            navigationItem.leftBarButtonItems = nil
+        } else {
+            setNavigationLeftItems()
+        }
+        setNavigationRightItems()
+
+        navigationController?.interactivePopGestureRecognizer?.isEnabled = !editMode
+        navigationItem.hidesBackButton = editMode
+        searchController(enabled: !editMode)
         collectionView.reloadData()
         collectionView.reloadData()
     }
     }
 }
 }

+ 28 - 23
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -160,6 +160,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         navigationController?.setNavigationBarHidden(false, animated: true)
         navigationController?.setNavigationBarHidden(false, animated: true)
         navigationItem.title = titleCurrentFolder
         navigationItem.title = titleCurrentFolder
 
 
+        isEditMode = false
         setNavigationLeftItems()
         setNavigationLeftItems()
         setNavigationRightItems()
         setNavigationRightItems()
 
 
@@ -214,7 +215,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
 
         NCNetworking.shared.cancelUnifiedSearchFiles()
         NCNetworking.shared.cancelUnifiedSearchFiles()
         dismissTip()
         dismissTip()
-        setEditMode(false)
 
 
         // Cancel Queue & Retrieves Properties
         // Cancel Queue & Retrieves Properties
         NCNetworking.shared.downloadThumbnailQueue.cancelAll()
         NCNetworking.shared.downloadThumbnailQueue.cancelAll()
@@ -651,7 +651,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         navigationItem.title = titleCurrentFolder
         navigationItem.title = titleCurrentFolder
     }
     }
 
 
-    func setNavigationRightItems(enableMenu: Bool = false) {
+    func setNavigationRightItems() {
         guard layoutKey != NCGlobal.shared.layoutViewTransfers else { return }
         guard layoutKey != NCGlobal.shared.layoutViewTransfers else { return }
         let isTabBarHidden = self.tabBarController?.tabBar.isHidden ?? true
         let isTabBarHidden = self.tabBarController?.tabBar.isHidden ?? true
         let isTabBarSelectHidden = tabBarSelect.isHidden()
         let isTabBarSelectHidden = tabBarSelect.isHidden()
@@ -746,25 +746,23 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 self.setEditMode(false)
                 self.setEditMode(false)
             }
             }
             navigationItem.rightBarButtonItems = [select]
             navigationItem.rightBarButtonItems = [select]
-        } else {
+        } else if navigationItem.rightBarButtonItems == nil || (!isEditMode && !tabBarSelect.isHidden()) {
             tabBarSelect.hide()
             tabBarSelect.hide()
-            if navigationItem.rightBarButtonItems == nil || enableMenu {
-                let menuButton = UIBarButtonItem(image: utility.loadImage(named: "ellipsis.circle"), menu: UIMenu(children: createMenuActions()))
-                menuButton.tintColor = NCBrandColor.shared.iconImageColor
-                if layoutKey == NCGlobal.shared.layoutViewFiles {
-                    let notification = UIBarButtonItem(image: utility.loadImage(named: "bell"), style: .plain) {
-                        if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification {
-                            self.navigationController?.pushViewController(viewController, animated: true)
-                        }
+            let menuButton = UIBarButtonItem(image: utility.loadImage(named: "ellipsis.circle"), menu: UIMenu(children: createMenuActions()))
+            menuButton.tintColor = NCBrandColor.shared.iconImageColor
+            if layoutKey == NCGlobal.shared.layoutViewFiles {
+                let notification = UIBarButtonItem(image: utility.loadImage(named: "bell"), style: .plain) {
+                    if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification {
+                        self.navigationController?.pushViewController(viewController, animated: true)
                     }
                     }
-                    notification.tintColor = NCBrandColor.shared.iconImageColor
-                    navigationItem.rightBarButtonItems = [menuButton, notification]
-                } else {
-                    navigationItem.rightBarButtonItems = [menuButton]
                 }
                 }
+                notification.tintColor = NCBrandColor.shared.iconImageColor
+                navigationItem.rightBarButtonItems = [menuButton, notification]
             } else {
             } else {
-                navigationItem.rightBarButtonItems?.first?.menu = navigationItem.rightBarButtonItems?.first?.menu?.replacingChildren(createMenuActions())
+                navigationItem.rightBarButtonItems = [menuButton]
             }
             }
+        } else {
+            navigationItem.rightBarButtonItems?.first?.menu = navigationItem.rightBarButtonItems?.first?.menu?.replacingChildren(createMenuActions())
         }
         }
         // fix, if the tabbar was hidden before the update, set it in hidden
         // fix, if the tabbar was hidden before the update, set it in hidden
         if isTabBarHidden, isTabBarSelectHidden {
         if isTabBarHidden, isTabBarSelectHidden {
@@ -783,30 +781,37 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
 
     // MARK: - SEARCH
     // MARK: - SEARCH
 
 
+    func searchController(enabled: Bool) {
+        guard enableSearchBar else { return }
+        searchController?.searchBar.isUserInteractionEnabled = enabled
+        if enabled {
+            searchController?.searchBar.alpha = 1
+        } else {
+            searchController?.searchBar.alpha = 0.3
+
+        }
+    }
+
     func updateSearchResults(for searchController: UISearchController) {
     func updateSearchResults(for searchController: UISearchController) {
         self.literalSearch = searchController.searchBar.text
         self.literalSearch = searchController.searchBar.text
     }
     }
 
 
     func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
     func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
-
         isSearchingMode = true
         isSearchingMode = true
         self.providers?.removeAll()
         self.providers?.removeAll()
         self.dataSource.clearDataSource()
         self.dataSource.clearDataSource()
         self.collectionView.reloadData()
         self.collectionView.reloadData()
-
         // TIP
         // TIP
         dismissTip()
         dismissTip()
     }
     }
 
 
     func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
     func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
-
         if isSearchingMode && self.literalSearch?.count ?? 0 >= 2 {
         if isSearchingMode && self.literalSearch?.count ?? 0 >= 2 {
             reloadDataSourceNetwork()
             reloadDataSourceNetwork()
         }
         }
     }
     }
 
 
     func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
     func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
-
         DispatchQueue.global().async {
         DispatchQueue.global().async {
             NCNetworking.shared.cancelUnifiedSearchFiles()
             NCNetworking.shared.cancelUnifiedSearchFiles()
             self.isSearchingMode = false
             self.isSearchingMode = false
@@ -824,14 +829,12 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     func tapShareListItem(with objectId: String, indexPath: IndexPath, sender: Any) {
     func tapShareListItem(with objectId: String, indexPath: IndexPath, sender: Any) {
-        if isEditMode { return }
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId) else { return }
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId) else { return }
 
 
         NCActionCenter.shared.openShare(viewController: self, metadata: metadata, page: .sharing)
         NCActionCenter.shared.openShare(viewController: self, metadata: metadata, page: .sharing)
     }
     }
 
 
     func tapMoreGridItem(with objectId: String, namedButtonMore: String, image: UIImage?, indexPath: IndexPath, sender: Any) {
     func tapMoreGridItem(with objectId: String, namedButtonMore: String, image: UIImage?, indexPath: IndexPath, sender: Any) {
-        if isEditMode { return }
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId) else { return }
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId) else { return }
 
 
         if namedButtonMore == NCGlobal.shared.buttonMoreMore || namedButtonMore == NCGlobal.shared.buttonMoreLock {
         if namedButtonMore == NCGlobal.shared.buttonMoreMore || namedButtonMore == NCGlobal.shared.buttonMoreLock {
@@ -1704,7 +1707,9 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout {
 
 
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
         var height: CGFloat = 0
         var height: CGFloat = 0
-        if dataSource.getMetadataSourceForAllSections().isEmpty {
+        if isEditMode {
+            return CGSize.zero
+        } else if dataSource.getMetadataSourceForAllSections().isEmpty {
             height = NCGlobal.shared.getHeightHeaderEmptyData(view: view, portraitOffset: emptyDataPortaitOffset, landscapeOffset: emptyDataLandscapeOffset, isHeaderMenuTransferViewEnabled: isHeaderMenuTransferViewEnabled())
             height = NCGlobal.shared.getHeightHeaderEmptyData(view: view, portraitOffset: emptyDataPortaitOffset, landscapeOffset: emptyDataLandscapeOffset, isHeaderMenuTransferViewEnabled: isHeaderMenuTransferViewEnabled())
         } else {
         } else {
             let (heightHeaderCommands, heightHeaderRichWorkspace, heightHeaderSection) = getHeaderHeight(section: section)
             let (heightHeaderCommands, heightHeaderRichWorkspace, heightHeaderSection) = getHeaderHeight(section: section)

+ 1 - 1
iOSClient/SceneDelegate.swift

@@ -21,7 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 //
 
 
-import Foundation
+import UIKit
 import NextcloudKit
 import NextcloudKit
 import WidgetKit
 import WidgetKit
 import SwiftEntryKit
 import SwiftEntryKit

+ 6 - 1
iOSClient/Trash/NCTrash+SelectTabBarDelegate.swift

@@ -69,7 +69,12 @@ extension NCTrash: NCTrashSelectTabBarDelegate {
     func setEditMode(_ editMode: Bool) {
     func setEditMode(_ editMode: Bool) {
         isEditMode = editMode
         isEditMode = editMode
         selectOcId.removeAll()
         selectOcId.removeAll()
-        setNavigationRightItems(enableMenu: !editMode)
+
+        setNavigationRightItems()
+
+        navigationController?.interactivePopGestureRecognizer?.isEnabled = !editMode
+        navigationItem.hidesBackButton = editMode
         collectionView.reloadData()
         collectionView.reloadData()
+
     }
     }
 }
 }

+ 9 - 15
iOSClient/Trash/NCTrash.swift

@@ -76,8 +76,6 @@ class NCTrash: UIViewController, NCTrashListCellDelegate, NCTrashGridCellDelegat
         refreshControl.tintColor = NCBrandColor.shared.textColor2
         refreshControl.tintColor = NCBrandColor.shared.textColor2
         refreshControl.addTarget(self, action: #selector(loadListingTrash), for: .valueChanged)
         refreshControl.addTarget(self, action: #selector(loadListingTrash), for: .valueChanged)
 
 
-        setNavigationRightItems()
-
         NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterReloadDataSource), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterReloadDataSource), object: nil)
     }
     }
 
 
@@ -94,6 +92,9 @@ class NCTrash: UIViewController, NCTrashListCellDelegate, NCTrashGridCellDelegat
             collectionView.collectionViewLayout = gridLayout
             collectionView.collectionViewLayout = gridLayout
         }
         }
 
 
+        isEditMode = false
+        setNavigationRightItems()
+
         reloadDataSource()
         reloadDataSource()
         loadListingTrash()
         loadListingTrash()
     }
     }
@@ -106,11 +107,6 @@ class NCTrash: UIViewController, NCTrashListCellDelegate, NCTrashGridCellDelegat
         dataSourceTask?.cancel()
         dataSourceTask?.cancel()
     }
     }
 
 
-    override func viewDidDisappear(_ animated: Bool) {
-        super.viewDidDisappear(animated)
-        setEditMode(false)
-    }
-
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
         super.viewWillTransition(to: size, with: coordinator)
         super.viewWillTransition(to: size, with: coordinator)
 
 
@@ -129,7 +125,7 @@ class NCTrash: UIViewController, NCTrashListCellDelegate, NCTrashGridCellDelegat
 
 
     // MARK: - Layout
     // MARK: - Layout
 
 
-    func setNavigationRightItems(enableMenu: Bool = false) {
+    func setNavigationRightItems() {
         func createMenuActions() -> [UIMenuElement] {
         func createMenuActions() -> [UIMenuElement] {
             guard let layoutForView = NCManageDatabase.shared.getLayoutForView(account: appDelegate.account, key: layoutKey, serverUrl: "") else { return [] }
             guard let layoutForView = NCManageDatabase.shared.getLayoutForView(account: appDelegate.account, key: layoutKey, serverUrl: "") else { return [] }
             let select = UIAction(title: NSLocalizedString("_select_", comment: ""), image: utility.loadImage(named: "checkmark.circle", colors: [NCBrandColor.shared.iconImageColor]), attributes: self.datasource.isEmpty ? .disabled : []) { _ in
             let select = UIAction(title: NSLocalizedString("_select_", comment: ""), image: utility.loadImage(named: "checkmark.circle", colors: [NCBrandColor.shared.iconImageColor]), attributes: self.datasource.isEmpty ? .disabled : []) { _ in
@@ -155,14 +151,12 @@ class NCTrash: UIViewController, NCTrashListCellDelegate, NCTrashGridCellDelegat
                 self.setEditMode(false)
                 self.setEditMode(false)
             }
             }
             navigationItem.rightBarButtonItems = [select]
             navigationItem.rightBarButtonItems = [select]
-        } else {
+        } else if navigationItem.rightBarButtonItems == nil || (!isEditMode && !tabBarSelect.isHidden()) {
             tabBarSelect.hide()
             tabBarSelect.hide()
-            if navigationItem.rightBarButtonItems == nil || enableMenu {
-                let menu = UIBarButtonItem(image: utility.loadImage(named: "ellipsis.circle", colors: [NCBrandColor.shared.iconImageColor]), menu: UIMenu(children: createMenuActions()))
-                navigationItem.rightBarButtonItems = [menu]
-            } else {
-                navigationItem.rightBarButtonItems?.first?.menu = navigationItem.rightBarButtonItems?.first?.menu?.replacingChildren(createMenuActions())
-            }
+            let menu = UIBarButtonItem(image: utility.loadImage(named: "ellipsis.circle", colors: [NCBrandColor.shared.iconImageColor]), menu: UIMenu(children: createMenuActions()))
+            navigationItem.rightBarButtonItems = [menu]
+        } else {
+            navigationItem.rightBarButtonItems?.first?.menu = navigationItem.rightBarButtonItems?.first?.menu?.replacingChildren(createMenuActions())
         }
         }
     }
     }
 
 

+ 5 - 0
iOSClient/Trash/NCTrashSelectTabBar.swift

@@ -78,6 +78,11 @@ class NCTrashSelectTabBar: ObservableObject {
     func update(selectOcId: [String]) {
     func update(selectOcId: [String]) {
         isSelectedEmpty = selectOcId.isEmpty
         isSelectedEmpty = selectOcId.isEmpty
     }
     }
+
+    func isHidden() -> Bool {
+        guard let hostingController else { return false }
+        return hostingController.view.isHidden
+    }
 }
 }
 
 
 struct NCTrashSelectTabBarView: View {
 struct NCTrashSelectTabBarView: View {