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:
parent
23e4915d60
commit
9ec23ceed6
1 changed files with 11 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue