Skip to content

Commit

Permalink
Return null from VoltageConnectionIO.fromStateObject, see #968
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 18, 2023
1 parent f8b1297 commit 73d930b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/model/VoltageConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ export default class VoltageConnection {
connection: ReferenceIO( IOType.ObjectIO ).toStateObject( voltageConnection.circuitElement || voltageConnection.vertex ),
voltage: voltageConnection.voltage
} ),
fromStateObject: stateObject => {

// Like in DerivedProperty, this is a no-op because the value is not used to restore the state
// Will be recomputed after the model is restored. This code relies on the assumption that the VoltageConnectionIO
// is contained in a NullableIO()
return null;
},
stateSchema: {
connection: ReferenceIO( IOType.ObjectIO ),
voltage: NumberIO
Expand Down

0 comments on commit 73d930b

Please sign in to comment.