-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #240 - cannot delete nodes with multiple graphs. #246
Conversation
ajbogh
commented
Aug 5, 2020
@@ -425,7 +425,7 @@ class Edge extends React.Component<IEdgeProps> { | |||
) { | |||
let response = Edge.getDefaultIntersectResponse(); | |||
|
|||
if (trg[nodeKey] == null) { | |||
if (trg == null || trg[nodeKey] == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a minor console error that shows up when a node is deleted and the connected edges try to calculate their positions.
const timeoutId = `nodes-${nodeId}`; | ||
|
||
// cancel an asyncRenderNode animation | ||
cancelAnimationFrame(this.nodeTimeouts[timeoutId]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the race condition bug by cancelling the asyncRenderNode method. Now nodes are deleted and stay deleted.
@@ -605,7 +612,7 @@ class GraphView extends React.Component<IGraphViewProps, IGraphViewState> { | |||
} | |||
}; | |||
|
|||
handleEdgeSelected = e => { | |||
handleEdgeSelected = (e: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor flowtype redline fix.
@@ -25,6 +25,7 @@ export type IEdgeType = IEdge; | |||
export { default as GraphUtils } from './utilities/graph-util'; | |||
export { default as Node } from './components/node'; | |||
export type INodeType = INode; | |||
// eslint-disable-next-line prettier/prettier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes an annoying problem with prettier trying to fix the line breaks when it doesn't need to.