fix: assets not loading on published graphs that arent under /

This commit is contained in:
Gabriel Horner
2023-12-01 13:37:55 -05:00
parent 86928f9881
commit b48f69b80b

View File

@@ -1431,7 +1431,8 @@
"Make asset URL for UI element, to fill img.src"
[path] ;; path start with "/assets"(editor) or compatible for "../assets"(whiteboards)
(if config/publishing?
path
;; Relative path needed since assets are not under '/' if published graph is not under '/'
(string/replace-first path #"^/" "")
(let [repo (state/get-current-repo)
repo-dir (config/get-repo-dir repo)
;; Hack for path calculation