-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref(related_issues): Make the code a bit more clear #71999
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
Conversation
| const {oneOtherIssueEvent} = useTraceTimelineEvents({ | ||
| event, | ||
| }); | ||
| const readyToShow = !isLoading && !isError; |
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 condition is not really necessary as you will see below.
| {isRelatedIssuesEnabled && readyToShow && oneOtherIssueEvent === undefined && ( | ||
| <TraceLink event={event} /> | ||
| )} | ||
| {isRelatedIssuesEnabled && oneOtherIssueEvent && ( |
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.
If oneOtherIssueEvent is defined, we know that the data was fetched and that there was no error.
| return ( | ||
| <StyledDataSection> | ||
| <GroupEventCarousel group={group} event={event} projectSlug={project.slug} /> | ||
| {isRelatedIssuesEnabled && readyToShow && oneOtherIssueEvent === 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.
Moving this block closer to <TraceTimeline> since they would be shown together.
Bundle ReportChanges will decrease total bundle size by 37 bytes ⬇️
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #71999 +/- ##
===========================================
+ Coverage 56.90% 77.94% +21.04%
===========================================
Files 6562 6572 +10
Lines 292314 292600 +286
Branches 50471 50519 +48
===========================================
+ Hits 166330 228057 +61727
+ Misses 121241 58292 -62949
- Partials 4743 6251 +1508
|
When fetching events, `oneOtherIssueEvent` is `undefined`, thus, we need to wait until we're certain that the fetch has been completed to prevent rendering twice or the wrong state. I introduced this problem in #71999.
No description provided.