From b48f69b80bbb2f56ebb8b6584030474cd5cceb3e Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 1 Dec 2023 13:37:55 -0500 Subject: [PATCH] fix: assets not loading on published graphs that arent under / --- src/main/frontend/handler/editor.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 05557f27b9..514cd80b65 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -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