0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-08 13:01:24 -05:00

Simplify code and use lookup helpers

This commit is contained in:
Andrey Antukh 2025-02-18 11:50:43 +01:00
parent 713d6a31df
commit f98dbef228

View file

@ -1190,12 +1190,11 @@
(ptk/reify ::notify-sync-file
ptk/WatchEvent
(watch [_ state _]
(let [file (dm/get-in state [:files file-id])
(let [file (dsh/lookup-file state file-id)
file-data (get file :data)
ignore-until (get file :ignore-sync-until)
;; FIXME: syntax of this can be improved
libraries-need-sync
(filter #(seq (assets-need-sync % file-data ignore-until))
(vals (get state :files)))
@ -1211,8 +1210,7 @@
(st/emit! (ntf/hide)))
do-dismiss
#(do (st/emit! ignore-sync)
(st/emit! (ntf/hide)))]
#(st/emit! ignore-sync (ntf/hide))]
(when (seq libraries-need-sync)
(rx/of (ntf/dialog