Skip to content

Commit ea1ed18

Browse files
committed
Error handling
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
1 parent 75b014f commit ea1ed18

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

iOSClient/Menu/NCContextMenu.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ class NCContextMenu: NSObject {
371371
return
372372
}
373373

374-
375374
NCNetworking.shared.setStatusWaitRename(metadata, fileNameNew: fileNameNew)
376375
}
377376
}
@@ -452,9 +451,9 @@ class NCContextMenu: NSObject {
452451
if let apps = capabilities.clientIntegration?.apps {
453452
for (appName, context) in apps {
454453
for item in context.contextMenu {
455-
if item.mimetypeFilters == nil || (item.mimetypeFilters?.contains(metadata.contentType) == true) {
454+
// if item.mimetypeFilters == nil || (item.mimetypeFilters?.contains(metadata.contentType) == true) {
456455

457-
let deferredElement = UIDeferredMenuElement { [self] completion in
456+
let deferredElement = UIDeferredMenuElement { completion in
458457
Task {
459458
var iconImage: UIImage
460459
if let iconUrl = item.icon,
@@ -469,7 +468,7 @@ class NCContextMenu: NSObject {
469468
)
470469
}
471470
} else {
472-
iconImage = utility.loadImage(
471+
iconImage = self.utility.loadImage(
473472
named: "testtube.2",
474473
colors: [NCBrandColor.shared.presentationIconColor]
475474
)
@@ -488,7 +487,9 @@ class NCContextMenu: NSObject {
488487
method: item.method,
489488
params: item.params)
490489

491-
if response.error == .success {
490+
if response.error != .success {
491+
NCContentPresenter().showError(error: response.error)
492+
} else {
492493
if let tooltip = response.uiResponse?.ocs.data.tooltip {
493494
NCContentPresenter().showCustomMessage(message: tooltip, type: .success)
494495
} else {
@@ -514,7 +515,7 @@ class NCContextMenu: NSObject {
514515

515516
menuElements.append(deferredElement)
516517
}
517-
}
518+
// }
518519
}
519520
}
520521

0 commit comments

Comments
 (0)