|
@@ -78,9 +78,13 @@
|
|
|
(if (and journal? new-name (not= old-page-name (string/lower-case new-name)))
|
|
(if (and journal? new-name (not= old-page-name (string/lower-case new-name)))
|
|
|
(notification/show! "Journal title can't be changed." :warning)
|
|
(notification/show! "Journal title can't be changed." :warning)
|
|
|
(let [new-name (if journal? (date/journal-title->default new-name) new-name)
|
|
(let [new-name (if journal? (date/journal-title->default new-name) new-name)
|
|
|
- new-path (if (= (string/lower-case new-name) (string/lower-case old-page-name))
|
|
|
|
|
- path
|
|
|
|
|
- (page-handler/compute-new-file-path path new-name))]
|
|
|
|
|
|
|
+ new-path (if new-name
|
|
|
|
|
+ (if (and
|
|
|
|
|
+ new-name old-page-name
|
|
|
|
|
+ (= (string/lower-case new-name) (string/lower-case old-page-name)))
|
|
|
|
|
+ path
|
|
|
|
|
+ (page-handler/compute-new-file-path path new-name))
|
|
|
|
|
+ path)]
|
|
|
(file/alter-file (state/get-current-repo) new-path (string/trim value)
|
|
(file/alter-file (state/get-current-repo) new-path (string/trim value)
|
|
|
{:re-render-root? true})))))))
|
|
{:re-render-root? true})))))))
|
|
|
(when-not (contains? #{:insert :indent-outdent :auto-save} (state/get-editor-op))
|
|
(when-not (contains? #{:insert :indent-outdent :auto-save} (state/get-editor-op))
|