-
Notifications
You must be signed in to change notification settings - Fork 20
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(react-components): Fix PointCloudFilterCommand because it didn't show up in Search #4703
Conversation
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.
LGTM 👍 Even though I'm not sure what exactly is making this work contra the previous solution 😅 Also, a couple of suggestions
for (const pointCloud of this.renderTarget.getPointClouds()) { | ||
if (this._modelId === pointCloud.modelId && this._revisionId === pointCloud.revisionId) { | ||
return pointCloud; | ||
} | ||
} | ||
return undefined; |
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 function could be rewritten as return this.renderTarget.getPointClouds().find(pointCloud => pointCloud.modelId === this._modelId && pointCloud.revisionId === this._revisionId)
. It returns undefined
if no applicable result is found
for (const pointCloud of this.renderTarget.getPointClouds()) { | ||
if (this._modelId === pointCloud.modelId && this._revisionId === pointCloud.revisionId) { | ||
return pointCloud; | ||
} | ||
} | ||
return undefined; |
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 could also be written with find
Type of change
Description 📝
I have changed the way to get the point cloud only. The new way is more secure for not having bugs.