0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 15:51:37 -05:00

🐛 Fix child compare in reset mode

This commit is contained in:
Andrés Moya 2024-03-07 17:32:52 +01:00 committed by Alejandro Alonso
parent 2c740df767
commit 2c12790782

View file

@ -1024,18 +1024,18 @@
:else :else
(if (or (ctk/is-main-of? child-main child-inst) (if (or (ctk/is-main-of? child-main child-inst)
(ctf/match-swap-slot? child-main child-inst container-inst container-main file libraries)) (and (ctf/match-swap-slot? child-main child-inst container-inst container-main file libraries) (not reset?)))
(recur (next children-inst) (recur (next children-inst)
(next children-main) (next children-main)
(if (or (ctk/is-main-of? child-main child-inst) reset?) (if (ctk/is-main-of? child-main child-inst)
(both-cb changes child-inst child-main) (both-cb changes child-inst child-main)
(swapped-cb changes child-inst child-main))) (swapped-cb changes child-inst child-main)))
(let [child-inst' (d/seek #(or (ctk/is-main-of? child-main %) (let [child-inst' (d/seek #(or (ctk/is-main-of? child-main %)
(ctf/match-swap-slot? child-main % container-inst container-main file libraries)) (and (ctf/match-swap-slot? child-main % container-inst container-main file libraries) (not reset?)))
children-inst) children-inst)
child-main' (d/seek #(or (ctk/is-main-of? % child-inst) child-main' (d/seek #(or (ctk/is-main-of? % child-inst)
(ctf/match-swap-slot? % child-inst container-inst container-main file libraries)) (and (ctf/match-swap-slot? % child-inst container-inst container-main file libraries) (not reset?)))
children-main)] children-main)]
(cond (cond
(nil? child-inst') (nil? child-inst')