-
Notifications
You must be signed in to change notification settings - Fork 50
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: add default value when destructuring collaborator options #966
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #966 +/- ##
=======================================
Coverage 67.76% 67.77%
=======================================
Files 128 128
Lines 3229 3230 +1
Branches 935 914 -21
=======================================
+ Hits 2188 2189 +1
- Misses 993 996 +3
+ Partials 48 45 -3 ☔ View full report in Codecov by Sentry. |
@@ -268,7 +268,7 @@ export class BaseEditCourseForm extends React.Component { | |||
|
|||
const { | |||
data: { | |||
results: allResults, | |||
results: allResults = [], |
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 the collaborators are not fetched, how will the retry occur if data is set to empty list here?
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.
Its just setting a default. Once the collaborators have been fetched, the state will update which will update the collaborator options with a "non-undefined" value for allResults
and then that will be used by the code.
[PS] Note that the collaborator info is in collaboratorOptions, and this is just pulling information out of that object.
4a8f48a
to
6963be2
Compare
06997ca
to
0e9d149
Compare
PROD-3229
Overview
It can happen that the collaborators have not been fetched before the page renders. This causes the collaborators to evaluate to undefined raising TypeErrors later when we try to use a
.map
on them