Marino Faggiana 1 yıl önce
ebeveyn
işleme
3f8df68945

+ 2 - 2
iOSClient/Menu/NCContextMenu.swift

@@ -156,7 +156,7 @@ class NCContextMenu: NSObject {
                 Task {
                     let error = await NCNetworking.shared.deleteMetadata(metadata, onlyLocalCache: false)
                     if error != .success {
-                        NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
+                        NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterDeleteFile, userInfo: ["error": error])
                         NCContentPresenter.shared.showError(error: error)
                     }
                 }
@@ -170,7 +170,7 @@ class NCContextMenu: NSObject {
             Task {
                 let error = await NCNetworking.shared.deleteMetadata(metadata, onlyLocalCache: true)
                 if error != .success {
-                    NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
+                    NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterDeleteFile, userInfo: ["error": error])
                     NCContentPresenter.shared.showError(error: error)
                 }
             }

+ 2 - 2
iOSClient/Menu/NCMenuAction.swift

@@ -142,7 +142,7 @@ extension NCMenuAction {
                                 error = await NCNetworking.shared.deleteMetadata(metadata, onlyLocalCache: false)
                             }
                             if error != .success {
-                                NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
+                                NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterDeleteFile, userInfo: ["error": error])
                                 NCContentPresenter.shared.showError(error: error)
                             }
                         }
@@ -159,7 +159,7 @@ extension NCMenuAction {
                                 error = await NCNetworking.shared.deleteMetadata(metadata, onlyLocalCache: true)
                             }
                             if error != .success {
-                                NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
+                                NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterDeleteFile, userInfo: ["error": error])
                                 NCContentPresenter.shared.showError(error: error)
                             }
                         }

+ 1 - 0
iOSClient/NCGlobal.swift

@@ -343,6 +343,7 @@ class NCGlobal: NSObject {
     let notificationCenterProgressTask                          = "progressTask"                    // userInfo: account, ocId, serverUrl, status, progress, totalBytes, totalBytesExpected
 
     let notificationCenterCreateFolder                          = "createFolder"                    // userInfo: ocId, serverUrl, account, e2ee, withPush
+    let notificationCenterDeleteFile                            = "deleteFile"                      // userInfo: error
     let notificationCenterRenameFile                            = "renameFile"                      // userInfo: ocId, account
     let notificationCenterMoveFile                              = "moveFile"                        // userInfo: ocId, account, serverUrlFrom
     let notificationCenterCopyFile                              = "copyFile"                        // userInfo: ocId, serverUrlTo