fix: merge issues

pull/5341/head
Peng Xiao 2022-10-08 17:27:19 +08:00
parent cca1d35510
commit 1588cf9bd4
2 changed files with 20 additions and 23 deletions

View File

@ -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])

View File

@ -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)))))