fix: clicking the file in the sync dialogue navigates to blank page

Closed https://github.com/logseq/logseq/issues/541
pull/645/head
Tienson Qin 2020-10-28 21:34:56 +08:00
parent 07d879ae89
commit 943d2b7b5c
5 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@
(let [parents-atom (atom parents) (let [parents-atom (atom parents)
component [:div.block-parents.flex-row.flex component [:div.block-parents.flex-row.flex
(when show-page? (when show-page?
[:a {:href (rfe/href :page {:name (util/encode-str page-name)})} [:a {:href (rfe/href :page {:name page-name})}
(or (:page/original-name page) (or (:page/original-name page)
(:page/name page))]) (:page/name page))])

View File

@ -254,7 +254,7 @@
page (string/lower-case page-name) page (string/lower-case page-name)
href (if html-export? href (if html-export?
(util/encode-str page) (util/encode-str page)
(rfe/href :page {:name (util/encode-str page)}))] (rfe/href :page {:name page}))]
[:a.page-ref [:a.page-ref
{:href href {:href href
:on-click (fn [e] :on-click (fn [e]

View File

@ -128,7 +128,7 @@
(= :home (state/get-current-route)) (= :home (state/get-current-route))
(not (state/route-has-p?))) (not (state/route-has-p?)))
(route-handler/redirect! {:to :page (route-handler/redirect! {:to :page
:path-params {:name (util/encode-str (:page default-home))}}) :path-params {:name (:page default-home)}})
(and (not logged?) (seq latest-journals)) (and (not logged?) (seq latest-journals))
(journal/journals latest-journals) (journal/journals latest-journals)

View File

@ -73,7 +73,7 @@
(for [file changed-files] (for [file changed-files]
[:li {:key (str "sync-" file)} [:li {:key (str "sync-" file)}
[:div.flex.flex-row.justify-between.align-items [:div.flex.flex-row.justify-between.align-items
[:a {:href (rfe/href :file {:path (util/encode-str file)})} [:a {:href (rfe/href :file {:path file})}
file] file]
[:a.ml-4.text-sm.mt-1 [:a.ml-4.text-sm.mt-1
{:on-click (fn [e] {:on-click (fn [e]

View File

@ -296,7 +296,7 @@
;; Redirect to the new page ;; Redirect to the new page
(route-handler/redirect! {:to :page (route-handler/redirect! {:to :page
:path-params {:name (util/encode-str (string/lower-case new-name))}}) :path-params {:name (string/lower-case new-name)}})
(notification/show! "Page renamed successfully!" :success) (notification/show! "Page renamed successfully!" :success)