Browse Source

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

Closed https://github.com/logseq/logseq/issues/541
Tienson Qin 5 years ago
parent
commit
943d2b7b5c

+ 1 - 1
src/main/frontend/components/block.cljs

@@ -19,7 +19,7 @@
        (let [parents-atom (atom parents)
              component [:div.block-parents.flex-row.flex
                         (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)
                                (:page/name page))])
 

+ 1 - 1
src/main/frontend/components/hiccup.cljs

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

+ 1 - 1
src/main/frontend/components/sidebar.cljs

@@ -128,7 +128,7 @@
               (= :home (state/get-current-route))
               (not (state/route-has-p?)))
          (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))
          (journal/journals latest-journals)

+ 1 - 1
src/main/frontend/components/widgets.cljs

@@ -73,7 +73,7 @@
                     (for [file changed-files]
                       [:li {:key (str "sync-" file)}
                        [: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]
                         [:a.ml-4.text-sm.mt-1
                          {:on-click (fn [e]

+ 1 - 1
src/main/frontend/handler/page.cljs

@@ -296,7 +296,7 @@
 
         ;; Redirect to the new 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)