فهرست منبع

fix: links not resolving

fixes https://github.com/logseq/db-test/issues/311
Tienson Qin 7 ماه پیش
والد
کامیت
fac981bea0

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

@@ -615,10 +615,10 @@
   [config page-entity e page-name contents-page?]
   (when (not (util/right-click? e))
     (p/let [ignore-alias? (:ignore-alias? config)
-            page (or (and (not ignore-alias?)
-                          (or (first (:block/_alias page-entity))
-                              (db-async/<get-block-source (state/get-current-repo) (:db/id page-entity))))
-                     page-entity)]
+            source-page (and (not ignore-alias?)
+                             (or (first (:block/_alias page-entity))
+                                 (db-async/<get-block-source (state/get-current-repo) (:db/id page-entity))))
+            page (or source-page page-entity)]
       (cond
         (gobj/get e "shiftKey")
         (when page

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

@@ -108,7 +108,7 @@
     (when page?
       [:div.ls-block.block-add-button.flex-1.flex-col.rounded-sm.cursor-text.transition-opacity.ease-in.duration-100.!py-0
        {:class opacity-class
-        :data-blockId (:db/id block)
+        :data-block-id (:db/id block)
         :ref *ref
         :on-click (fn [e]
                     (util/stop e)

+ 4 - 4
src/main/frontend/handler/common/page.cljs

@@ -2,7 +2,8 @@
   "Common fns for file and db based page handlers, including create!, delete!
   and favorite fns. This ns should be agnostic of file or db concerns but there
   is still some file-specific tech debt to remove from create!"
-  (:require [clojure.string :as string]
+  (:require [clojure.set :as set]
+            [clojure.string :as string]
             [datascript.core :as d]
             [dommy.core :as dom]
             [frontend.config :as config]
@@ -21,8 +22,7 @@
             [logseq.common.util :as common-util]
             [logseq.common.util.page-ref :as page-ref]
             [logseq.db :as ldb]
-            [promesa.core :as p]
-            [clojure.set :as set]))
+            [promesa.core :as p]))
 
 (defn- wrap-tags
   "Tags might have multiple words"
@@ -83,7 +83,7 @@
                  (js/setTimeout
                   (fn []
                     (when-let [block-add-button (->> (dom/sel ".block-add-button")
-                                                     (filter #(= (str (:db/id page)) (dom/attr % "data-blockId")))
+                                                     (filter #(= (str (:db/id page)) (dom/attr % "data-block-id")))
                                                      first)]
                       (.click block-add-button)))
                   200)))