mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 08:56:29 +00:00
fix(pdf): incorrect cmapurl for web https://github.com/logseq/db-test/issues/180
This commit is contained in:
@@ -966,16 +966,17 @@
|
||||
opts {:url url
|
||||
:password (or doc-password "")
|
||||
:ownerDocument (.-ownerDocument loader-el)
|
||||
:cMapUrl "./js/pdfjs/cmaps/"
|
||||
:cMapUrl (str (if (some-> js/location.host (string/ends-with? "logseq.com"))
|
||||
"./static/" "./") "js/pdfjs/cmaps/")
|
||||
;:cMapUrl "https://cdn.jsdelivr.net/npm/pdfjs-dist@3.9.179/cmaps/"
|
||||
:cMapPacked true}]
|
||||
|
||||
:cMapPacked true}]
|
||||
(js-debugger)
|
||||
(set-loader-state! {:status :loading})
|
||||
|
||||
(-> (get-doc$ (clj->js opts))
|
||||
(p/then (fn [doc]
|
||||
(set-loader-state! {:pdf-document doc :status :completed})))
|
||||
(p/catch #(set-loader-state! {:error %})))
|
||||
(p/then (fn [doc]
|
||||
(set-loader-state! {:pdf-document doc :status :completed})))
|
||||
(p/catch #(set-loader-state! {:error %})))
|
||||
#()))
|
||||
[url doc-password])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user