Explorar o código

fix: uneditable journal title shouldn't be editable

when on the journal page. Fixes logseq/db-test#67.
Also fix kondo lints
Gabriel Horner hai 1 ano
pai
achega
53a86bac0d
Modificáronse 2 ficheiros con 9 adicións e 7 borrados
  1. 1 1
      src/electron/electron/core.cljs
  2. 8 6
      src/main/frontend/components/block.cljs

+ 1 - 1
src/electron/electron/core.cljs

@@ -14,7 +14,7 @@
             [electron.fs-watcher :as fs-watcher]
             ["path" :as node-path]
             ["os" :as os]
-            ["electron" :refer [BrowserWindow Menu app protocol ipcMain dialog shell session] :as electron]
+            ["electron" :refer [BrowserWindow Menu app protocol ipcMain dialog shell] :as electron]
             ["electron-deeplink" :refer [Deeplink]]
             [electron.git :as git]
             [electron.window :as win]

+ 8 - 6
src/main/frontend/components/block.cljs

@@ -70,7 +70,6 @@
             [frontend.handler.property.file :as property-file]
             [frontend.handler.file-based.property.util :as property-util]
             [frontend.util.text :as text-util]
-            [frontend.handler.db-based.property.util :as db-pu]
             [goog.dom :as gdom]
             [goog.object :as gobj]
             [lambdaisland.glogi :as log]
@@ -2530,11 +2529,14 @@
 
                 (not block-ref?)
                 (assoc mouse-down-key (fn [e]
-                                        (if (:from-journals? config)
-                                          (do
-                                            (.preventDefault e)
-                                            (route-handler/redirect-to-page! (:block/uuid block)))
-                                          (block-content-on-pointer-down e block block-id content edit-input-id config)))))]
+                                        (cond (:from-journals? config)
+                                              (do
+                                                (.preventDefault e)
+                                                (route-handler/redirect-to-page! (:block/uuid block)))
+                                              (ldb/journal? block)
+                                              (.preventDefault e)
+                                              :else
+                                              (block-content-on-pointer-down e block block-id content edit-input-id config)))))]
     [:div.block-content.inline
      (cond-> {:id (str "block-content-" uuid)
               :on-pointer-up (fn [e]