mirror of
https://github.com/penpot/penpot.git
synced 2025-06-08 10:51:37 +02:00
🐛 Don't navigate when no frame/index found on viewer.
This commit is contained in:
parent
b0fbc86ca7
commit
29669b8b0f
3 changed files with 4 additions and 2 deletions
|
@ -322,7 +322,8 @@
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
(let [frames (get-in state [:viewer-data :frames])
|
(let [frames (get-in state [:viewer-data :frames])
|
||||||
index (d/index-of-pred frames #(= (:id %) frame-id))]
|
index (d/index-of-pred frames #(= (:id %) frame-id))]
|
||||||
(rx/of (go-to-frame-by-index index))))))
|
(when index
|
||||||
|
(rx/of (go-to-frame-by-index index)))))))
|
||||||
|
|
||||||
(defn set-current-frame [frame-id]
|
(defn set-current-frame [frame-id]
|
||||||
(ptk/reify ::current-frame
|
(ptk/reify ::current-frame
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
:navigate
|
:navigate
|
||||||
(let [frame-id (:destination interaction)]
|
(let [frame-id (:destination interaction)]
|
||||||
(st/emit! (dv/go-to-frame frame-id)))
|
(st/emit! (dv/go-to-frame frame-id)))
|
||||||
|
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(defn generic-wrapper-factory
|
(defn generic-wrapper-factory
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue