Просмотр исходного кода

fix: assets not showing up for publishing

Not showing images or pdfs
Gabriel Horner 8 месяцев назад
Родитель
Сommit
ea6d2678f6
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/main/frontend/components/block.cljs

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

@@ -1034,7 +1034,10 @@
                  (let [block (last (:rum/args state))
                        asset-type (:logseq.property.asset/type block)
                        path (path/path-join common-config/local-assets-dir (str (:block/uuid block) "." asset-type))]
-                   (p/let [result (fs/file-exists? (config/get-repo-dir (state/get-current-repo)) path)]
+                   (p/let [result (if config/publishing?
+                                    ;; publishing doesn't have window.pfs defined
+                                    true
+                                    (fs/file-exists? (config/get-repo-dir (state/get-current-repo)) path))]
                      (reset! (::file-exists? state) result))
                    state))}
   [state config block]