Explorar o código

fix: draw links

Tienson Qin %!s(int64=4) %!d(string=hai) anos
pai
achega
84dd5eb233
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      src/main/frontend/components/block.cljs

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

@@ -289,8 +289,10 @@
        [:span.text-gray-500 "[["])
      (if (string/ends-with? s ".excalidraw")
        [:a.page-ref
-        {:href (rfe/href :draw nil {:file (string/replace s (str config/default-draw-directory "/") "")})
-         :on-click (fn [e] (util/stop e))}
+        {:on-click (fn [e]
+                     (util/stop e)
+                     (set! (.-href js/window.location)
+                           (rfe/href :draw nil {:file (string/replace s (str config/default-draw-directory "/") "")})))}
         [:span
          (svg/excalidraw-logo)
          (string/capitalize (draw/get-file-title s))]]