mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 10:51:39 +02:00
✨ Simplify code and use lookup helpers
This commit is contained in:
parent
713d6a31df
commit
f98dbef228
1 changed files with 3 additions and 5 deletions
|
@ -1190,12 +1190,11 @@
|
||||||
(ptk/reify ::notify-sync-file
|
(ptk/reify ::notify-sync-file
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(let [file (dm/get-in state [:files file-id])
|
(let [file (dsh/lookup-file state file-id)
|
||||||
|
|
||||||
file-data (get file :data)
|
file-data (get file :data)
|
||||||
ignore-until (get file :ignore-sync-until)
|
ignore-until (get file :ignore-sync-until)
|
||||||
|
|
||||||
|
|
||||||
;; FIXME: syntax of this can be improved
|
|
||||||
libraries-need-sync
|
libraries-need-sync
|
||||||
(filter #(seq (assets-need-sync % file-data ignore-until))
|
(filter #(seq (assets-need-sync % file-data ignore-until))
|
||||||
(vals (get state :files)))
|
(vals (get state :files)))
|
||||||
|
@ -1211,8 +1210,7 @@
|
||||||
(st/emit! (ntf/hide)))
|
(st/emit! (ntf/hide)))
|
||||||
|
|
||||||
do-dismiss
|
do-dismiss
|
||||||
#(do (st/emit! ignore-sync)
|
#(st/emit! ignore-sync (ntf/hide))]
|
||||||
(st/emit! (ntf/hide)))]
|
|
||||||
|
|
||||||
(when (seq libraries-need-sync)
|
(when (seq libraries-need-sync)
|
||||||
(rx/of (ntf/dialog
|
(rx/of (ntf/dialog
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue