enhance: today's journal should be displayed quickly for new graph

pull/3063/head
Tienson Qin 2021-11-03 22:10:35 +08:00
parent 0b07eb76df
commit 724cfc2b58
3 changed files with 11 additions and 9 deletions

View File

@ -19,6 +19,7 @@
[frontend.handler.editor :as editor-handler]
[frontend.handler.notification :as notification]
[frontend.handler.page :as page-handler]
[frontend.handler.ui :as ui-handler]
[frontend.spec :as spec]
[frontend.state :as state]
[frontend.ui :as ui]
@ -163,7 +164,8 @@
(page-handler/rename! old-title new-title))
(defmethod handle :page/create-today-journal [[_ repo]]
(page-handler/create-today-journal!))
(p/let [_ (page-handler/create-today-journal!)]
(ui-handler/re-render-root!)))
(defmethod handle :file/not-matched-from-disk [[_ path disk-content db-content]]
(state/clear-edit!)

View File

@ -378,7 +378,8 @@
(unfavorite-page! page-name)
(ok-handler)))))
(ok-handler)
(ui-handler/re-render-root!)))))
(defn- rename-page-aux [old-name new-name]
(when-let [repo (state/get-current-repo)]

View File

@ -154,13 +154,12 @@
(let [repo-dir (config/get-repo-dir repo-url)]
(p/let [_ (fs/mkdir-if-not-exists (str repo-dir "/" config/app-name))
_ (fs/mkdir-if-not-exists (str repo-dir "/" config/app-name "/" config/recycle-dir))
_ (fs/mkdir-if-not-exists (str repo-dir "/" (config/get-journals-directory)))]
(file-handler/create-metadata-file repo-url encrypted?)
;; TODO: move to frontend.handler.file
(create-config-file-if-not-exists repo-url)
(create-contents-file repo-url)
(create-favorites-file repo-url)
(create-custom-theme repo-url)
_ (fs/mkdir-if-not-exists (str repo-dir "/" (config/get-journals-directory)))
_ (file-handler/create-metadata-file repo-url encrypted?)
_ (create-config-file-if-not-exists repo-url)
_ (create-contents-file repo-url)
_ (create-favorites-file repo-url)
_ (create-custom-theme repo-url)]
(state/pub-event! [:page/create-today-journal repo-url])))))
(defn- remove-non-exists-refs!