1
0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-08-27 19:26:32 +02:00

🐛 Fix several SVG upload issues

This commit is contained in:
alonso.torres 2024-01-22 18:03:59 +01:00 committed by Andrey Antukh
commit 4f09688af7
8 changed files with 63 additions and 28 deletions
frontend/src/app/main/ui

View file

@ -215,11 +215,15 @@
([stream on-subscribe]
(use-stream stream (mf/deps) on-subscribe))
([stream deps on-subscribe]
(use-stream stream deps on-subscribe nil))
([stream deps on-subscribe on-dispose]
(mf/use-effect
deps
(fn []
(let [sub (->> stream (rx/subs! on-subscribe))]
#(rx/dispose! sub))))))
#(do
(rx/dispose! sub)
(when on-dispose (on-dispose))))))))
;; https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
(defn use-previous