mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 23:54:55 +00:00
Enhance/PDF viewer (#7369)
* fix(pdf): WIP potential memory leaks * enhance(pdf): sync page number in highlights metafile * enhance(pdf): support preview highlight area image in a lightbox * fix: clojurescript unit tests * fix(pdf): page number overflow when more digits
This commit is contained in:
@@ -296,10 +296,6 @@
|
||||
;; (re-)fetches get-current-repo needlessly
|
||||
;; TODO: Add consistent validation. Only a few config options validate at get time
|
||||
|
||||
(defn get-current-pdf
|
||||
[]
|
||||
(:pdf/current @state))
|
||||
|
||||
(def default-config
|
||||
"Default config for a repo-specific, user config"
|
||||
{:feature/enable-search-remove-accents? true
|
||||
@@ -1967,3 +1963,16 @@ Similar to re-frame subscriptions"
|
||||
[]
|
||||
(when (mobile-util/native-ios?)
|
||||
(get-in @state [:mobile/container-urls :iCloudContainerUrl])))
|
||||
|
||||
(defn get-current-pdf
|
||||
[]
|
||||
(:pdf/current @state))
|
||||
|
||||
(defn set-current-pdf!
|
||||
[inflated-file]
|
||||
(let [settle-file! #(set-state! :pdf/current inflated-file)]
|
||||
(if-not (get-current-pdf)
|
||||
(settle-file!)
|
||||
(when (apply not= (map :identity [inflated-file (get-current-pdf)]))
|
||||
(set-state! :pdf/current nil)
|
||||
(js/setTimeout #(settle-file!) 16)))))
|
||||
|
||||
Reference in New Issue
Block a user