mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-01 18:20:28 +00:00
Fix prototype editing to connect nodes correctly
This commit is contained in:
@@ -118,7 +118,7 @@ const Prototype = () => {
|
||||
}, [id]);
|
||||
|
||||
useEffect(() => {
|
||||
// if (template && template.features) {
|
||||
if (template && template.features) {
|
||||
const initialNodes = template?.features?.map((feature, index) => ({
|
||||
id: feature.id,
|
||||
type: 'featureCard',
|
||||
@@ -131,7 +131,7 @@ const Prototype = () => {
|
||||
}));
|
||||
|
||||
if (initialNodes) setNodes(initialNodes);
|
||||
// }
|
||||
}
|
||||
|
||||
if (prototype) {
|
||||
const initialEdges: Array<Edge> = [];
|
||||
@@ -159,12 +159,12 @@ const Prototype = () => {
|
||||
|
||||
const handleEditPrototype = () => {
|
||||
if (editing) {
|
||||
const prototypeInput = nodes
|
||||
.map((node) => ({
|
||||
featureId: node.id,
|
||||
const prototypeInput = edges
|
||||
.map((edge) => ({
|
||||
featureId: edge.source,
|
||||
connections: [
|
||||
{
|
||||
to: node.id,
|
||||
to: edge.target,
|
||||
releations: { back: false, forword: true },
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user