Skip to content

Commit a1d93da

Browse files
committed
Fix 'Grid' node migrations breaking up-to-date documents
1 parent 69ed80b commit a1d93da

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

editor/src/messages/portfolio/document_migration.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ pub fn document_migration_upgrades(document: &mut DocumentMessageHandler, reset_
639639
let old_inputs = document.network_interface.replace_inputs(node_id, network_path, &mut new_node_template).unwrap();
640640
let index_3_value = old_inputs.get(3).cloned();
641641

642+
let mut upgraded = false;
643+
642644
if let Some(NodeInput::Value { tagged_value, exposed: _ }) = index_3_value {
643645
if matches!(*tagged_value, TaggedValue::DVec2(_)) {
644646
// Move index 3 to the end
@@ -648,11 +650,14 @@ pub fn document_migration_upgrades(document: &mut DocumentMessageHandler, reset_
648650
document.network_interface.set_input(&InputConnector::node(*node_id, 3), old_inputs[4].clone(), network_path);
649651
document.network_interface.set_input(&InputConnector::node(*node_id, 4), old_inputs[5].clone(), network_path);
650652
document.network_interface.set_input(&InputConnector::node(*node_id, 5), old_inputs[3].clone(), network_path);
651-
} else {
652-
// Swap it back if we're not changing anything
653-
let _ = document.network_interface.replace_inputs(node_id, network_path, &mut current_node_template);
653+
654+
upgraded = true;
654655
}
655656
}
657+
658+
if !upgraded {
659+
let _ = document.network_interface.replace_inputs(node_id, network_path, &mut current_node_template);
660+
}
656661
}
657662

658663
// Ensure layers are positioned as stacks if they are upstream siblings of another layer

0 commit comments

Comments
 (0)