mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -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
|
||||
(watch [_ _ stream]
|
||||
(when (:timeout data)
|
||||
(let [stoper (rx/filter (ptk/type? ::show) stream)]
|
||||
(->> (rx/of hide)
|
||||
(rx/delay (:timeout data))
|
||||
(rx/take-until stoper)))))))
|
||||
(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)
|
||||
(let [stoper (rx/filter (ptk/type? ::show) stream)]
|
||||
(->> (rx/of hide)
|
||||
(rx/delay (:timeout data))
|
||||
(rx/take-until stoper))))))))
|
||||
|
||||
(def hide
|
||||
(ptk/reify ::hide
|
||||
|
|
Loading…
Reference in a new issue