diff --git a/src/main/frontend/handler/events.cljs b/src/main/frontend/handler/events.cljs index 968537f69..de642f09d 100644 --- a/src/main/frontend/handler/events.cljs +++ b/src/main/frontend/handler/events.cljs @@ -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!) diff --git a/src/main/frontend/handler/page.cljs b/src/main/frontend/handler/page.cljs index 9c9d0e4de..35d749285 100644 --- a/src/main/frontend/handler/page.cljs +++ b/src/main/frontend/handler/page.cljs @@ -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)] diff --git a/src/main/frontend/handler/repo.cljs b/src/main/frontend/handler/repo.cljs index 58eba535e..28cf8ed16 100644 --- a/src/main/frontend/handler/repo.cljs +++ b/src/main/frontend/handler/repo.cljs @@ -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!