fix: uploaded file cannot be opened in file graphs

fixed https://github.com/logseq/db-test/issues/298
This commit is contained in:
Tienson Qin
2025-06-24 16:12:54 +08:00
parent 1e59e8e635
commit e73caeb8f1

View File

@@ -1540,9 +1540,10 @@
(->elem
:a
(cond->
{:href (path/path-join "file://" path)
:data-href path
:target "_blank"}
{:on-click (fn [e]
(util/stop e)
(js/window.apis.openPath path))
:data-href path}
title
(assoc :title title))
(map-inline config label)))
@@ -1622,9 +1623,14 @@
href)]
(->elem
:a
(cond-> {:href (path/path-join "file://" href*)
:data-href href*
:target "_blank"}
(cond-> (if (util/electron?)
{:on-click (fn [e]
(util/stop e)
(js/window.apis.openPath path))
:data-href href*}
{:href (path/path-join "file://" href*)
:data-href href*
:target "_blank"})
title (assoc :title title))
(map-inline config label))))))