mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05: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
|
@ -87,7 +87,7 @@
|
|||
|
||||
(defn index-of-pred
|
||||
[coll pred]
|
||||
(loop [c (first coll)
|
||||
(loop [c (first coll)
|
||||
coll (rest coll)
|
||||
index 0]
|
||||
(if (nil? c)
|
||||
|
|
|
@ -322,7 +322,8 @@
|
|||
(watch [_ state stream]
|
||||
(let [frames (get-in state [:viewer-data :frames])
|
||||
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]
|
||||
(ptk/reify ::current-frame
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
:navigate
|
||||
(let [frame-id (:destination interaction)]
|
||||
(st/emit! (dv/go-to-frame frame-id)))
|
||||
|
||||
nil)))
|
||||
|
||||
(defn generic-wrapper-factory
|
||||
|
|
Loading…
Reference in a new issue