Skip to content

Commit

Permalink
fix: ProfileExplorer does not highlight keys that were just added
Browse files Browse the repository at this point in the history
  • Loading branch information
starpit committed Sep 29, 2022
1 parent 5b110f8 commit d19271a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/plugin-codeflare/src/components/ProfileExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,13 @@ class ProfileCard extends React.PureComponent<ProfileCardProps, ProfileCardState
}

private treeNode(id: string, meta: Metadata, value: string) {
const justChanged = this.props.profilesDiff && this.props.profilesDiff[id]
// the `json-diff` npm has this behavior: for changed keys, the
// diff object will use that key (hence the `profilesDiff[id]`
// check); for added keys, the diff object will use a key
// `${id}__added`, and hence the second check
const justChanged =
this.props.profilesDiff && (this.props.profilesDiff[id] || this.props.profilesDiff[id + "__added"])

const title = (
<span>
{meta.title}
Expand Down

0 comments on commit d19271a

Please sign in to comment.