0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Hide popup messages when navigating out

This commit is contained in:
Andrés Moya 2021-07-14 14:15:53 +02:00 committed by Andrey Antukh
parent 23e4915d60
commit 9ec23ceed6

View file

@ -52,11 +52,17 @@
ptk/WatchEvent ptk/WatchEvent
(watch [_ _ stream] (watch [_ _ stream]
(rx/merge
(let [stoper (rx/filter (ptk/type? ::hide) stream)]
(->> stream
(rx/filter (ptk/type? :app.util.router/navigate))
(rx/map (constantly hide))
(rx/take-until stoper)))
(when (:timeout data) (when (:timeout data)
(let [stoper (rx/filter (ptk/type? ::show) stream)] (let [stoper (rx/filter (ptk/type? ::show) stream)]
(->> (rx/of hide) (->> (rx/of hide)
(rx/delay (:timeout data)) (rx/delay (:timeout data))
(rx/take-until stoper))))))) (rx/take-until stoper))))))))
(def hide (def hide
(ptk/reify ::hide (ptk/reify ::hide