@@ -28,7 +28,7 @@ export function CCComponentEditorNodePinPropertyEditor() {
2828 . getManyByNodeIdAndComponentPinId ( target . nodeId , target . componentPinId )
2929 . toSorted ( ( a , b ) => a . order - b . order ) ;
3030 invariant (
31- nodePins . every ( ( p ) => p . userSpecifiedBitWidth !== null ) ,
31+ nodePins . every ( ( p ) => p . manualBitWidth !== null ) ,
3232 "NodePinPropertyEditor can only be used for node pins with user specified bit width" ,
3333 ) ;
3434 const componentPinAttributes = nullthrows (
@@ -64,7 +64,7 @@ export function CCComponentEditorNodePinPropertyEditor() {
6464
6565 const bitWidthList =
6666 newBitWidthList ??
67- nodePins . map ( ( nodePin ) => nullthrows ( nodePin . userSpecifiedBitWidth ) ) ;
67+ nodePins . map ( ( nodePin ) => nullthrows ( nodePin . manualBitWidth ) ) ;
6868
6969 const isTouched = Boolean ( newBitWidthList ) ;
7070 const isValid = bitWidthList . every ( ( bitWidth ) => bitWidth > 0 ) ;
@@ -103,7 +103,7 @@ export function CCComponentEditorNodePinPropertyEditor() {
103103 componentPinId : target . componentPinId ,
104104 nodeId : target . nodeId ,
105105 order : ++ maxOrder ,
106- userSpecifiedBitWidth : bitWidth ,
106+ manualBitWidth : bitWidth ,
107107 } ) ,
108108 ) ;
109109 continue ;
@@ -116,10 +116,24 @@ export function CCComponentEditorNodePinPropertyEditor() {
116116 // Update NodePin
117117 if ( nodePin && bitWidth ) {
118118 maxOrder = nodePin . order ; // nodePins are sorted by order
119- if ( nodePin . userSpecifiedBitWidth !== bitWidth )
119+ if ( nodePin . manualBitWidth !== bitWidth ) {
120120 store . nodePins . update ( nodePin . id , {
121- userSpecifiedBitWidth : bitWidth ,
121+ manualBitWidth : bitWidth ,
122122 } ) ;
123+ const connections = store . connections . getConnectionsByNodePinId (
124+ nodePin . id ,
125+ ) ;
126+ for ( const connection of connections ) {
127+ const anotherNodePinId = connection . from === nodePin . id
128+ ? connection . to
129+ : connection . from ;
130+ if ( ! store . nodePins . isConnectable (
131+ nodePin . id , anotherNodePinId
132+ ) ) {
133+ store . connections . unregister ( [ connection . id ] ) ;
134+ }
135+ }
136+ }
123137 continue ;
124138 }
125139 throw new Error ( "Unreachable" ) ;
0 commit comments