0
Fork 0
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:
Andrey Antukh 2020-11-25 20:08:39 +01:00 committed by Hirunatan
parent b0fbc86ca7
commit 29669b8b0f
3 changed files with 4 additions and 2 deletions

View file

@ -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)

View file

@ -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

View file

@ -38,6 +38,7 @@
:navigate
(let [frame-id (:destination interaction)]
(st/emit! (dv/go-to-frame frame-id)))
nil)))
(defn generic-wrapper-factory