marinofaggiana 4 年之前
父節點
當前提交
926393c503
共有 1 個文件被更改,包括 12 次插入5 次删除
  1. 12 5
      iOSClient/Utility/NCUtility.swift

+ 12 - 5
iOSClient/Utility/NCUtility.swift

@@ -338,29 +338,36 @@ class NCUtility: NSObject {
     
     @objc func isDirectEditing(account: String, contentType: String) -> String? {
         
+        var editor: String?
+        
         guard let results = NCManageDatabase.sharedInstance.getDirectEditingEditors(account: account) else {
-            return nil
+            return editor
         }
         
         for result: tableDirectEditingEditors in results {
             for mimetype in result.mimetypes {
                 if mimetype == contentType {
-                    return result.editor
+                    editor = result.editor
                 }
                 // HARDCODE
                 // https://github.com/nextcloud/text/issues/913
                 if mimetype == "text/markdown" && contentType == "text/x-markdown" {
-                    return result.editor
+                    editor = result.editor
                 }
             }
             for mimetype in result.optionalMimetypes {
                 if mimetype == contentType {
-                    return result.editor
+                    editor = result.editor
                 }
             }
         }
         
-        return nil
+        // HARDCODE
+        if editor == "" {
+            editor = k_editor_text
+        }
+        
+        return editor
     }
     
     @objc func removeAllSettings() {