浏览代码

fix: merge issues

Peng Xiao 3 年之前
父节点
当前提交
1588cf9bd4
共有 2 个文件被更改,包括 20 次插入23 次删除
  1. 4 4
      src/main/frontend/components/page.cljs
  2. 16 19
      src/main/frontend/handler/common/file.cljs

+ 4 - 4
src/main/frontend/components/page.cljs

@@ -279,11 +279,11 @@
           *edit? (get state ::edit?)
           *input-value (get state ::input-value)
           repo (state/get-current-repo)
-          hls-file? (pdf-assets/hls-file? title)
+          hls-page? (pdf-assets/hls-page? title)
           whiteboard-page? (model/whiteboard-page? page-name)
           untitled? (and whiteboard-page? (parse-uuid page-name)) ;; normal page cannot be untitled right?
-          title (if hls-file?
-                  (pdf-assets/human-hls-filename-display title)
+          title (if hls-page?
+                  (pdf-assets/human-hls-pagename-display title)
                   (if fmt-journal? (date/journal-title->custom-format title) title))
           old-name (or title page-name)]
       [:h1.page-title.flex.cursor-pointer.gap-1
@@ -298,7 +298,7 @@
                            repo
                            (:db/id page)
                            :page))
-                        (when (and (not hls-file?) (not fmt-journal?))
+                        (when (and (not hls-page?) (not fmt-journal?))
                           (reset! *input-value (if untitled? "" old-name))
                           (reset! *edit? true))))}
        (when (not= icon "") [:span.page-icon icon])

+ 16 - 19
src/main/frontend/handler/common/file.cljs

@@ -57,22 +57,19 @@
                 (and (mobile-util/native-ios?) (not= "/" (first file)))
                 file
 
-                  :else
-                  file)
-           file (gp-util/path-normalize file)
-           new? (nil? (db/entity [:file/path file]))
-           options (merge (dissoc options :verbose)
-                          {:new? new?
-                           :delete-blocks-fn (partial get-delete-blocks repo-url)
-                           :extract-options (merge
-                                             {:user-config (state/get-config)
-                                              :date-formatter (state/get-date-formatter)
-                                              :block-pattern (config/get-block-pattern (gp-util/get-format file))
-                                              :supported-formats (gp-config/supported-formats)
-                                              :uri-encoded? (boolean (util/mobile?))
-                                              :filename-format (state/get-filename-format repo-url)}
-                                             (when (some? verbose) {:verbose verbose}))})]
-       (:tx (graph-parser/parse-file (db/get-db repo-url false) file content options)))
-     (catch :default e
-       (prn "Reset file failed " {:file file})
-       (log/error :exception e)))))
+                :else
+                file)
+         file (gp-util/path-normalize file)
+         new? (nil? (db/entity [:file/path file]))
+         options (merge (dissoc options :verbose)
+                        {:new? new?
+                         :delete-blocks-fn (partial get-delete-blocks repo-url)
+                         :extract-options (merge
+                                           {:user-config (state/get-config)
+                                            :date-formatter (state/get-date-formatter)
+                                            :block-pattern (config/get-block-pattern (gp-util/get-format file))
+                                            :supported-formats (gp-config/supported-formats)
+                                            :uri-encoded? (boolean (util/mobile?))
+                                            :filename-format (state/get-filename-format repo-url)}
+                                           (when (some? verbose) {:verbose verbose}))})]
+     (:tx (graph-parser/parse-file (db/get-db repo-url false) file content options)))))