Skip to content

Commit

Permalink
add defaults for nested objects in user properties
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Nov 3, 2023
1 parent 45f46ca commit 513a920
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ describe("EditChallenges", () => {
expect(challengeTwo).toBeInTheDocument();
});
});

//props.user?.properties?.mr3Frontend?.settings?.tallied?.[(props.project.id)];
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class FilterByCategorizationKeywords extends Component {

render() {
const categorizationFilters = this.props.searchFilters?.categorizationKeywords ?? [];
const categories = this.props.user?.properties.mr3Frontend.settings.categorizationKeys ?? [];
const categories = this.props.user?.properties?.mr3Frontend?.settings?.categorizationKeys ?? [];

return (
<Dropdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const mapStateToProps = (state, ownProps) => {
const isVirtual = _isFinite(ownProps.virtualChallengeId)
const concreteChallengeId = _get(ownProps, 'challenge.id', ownProps.challengeId)
const challengeId = isVirtual ? ownProps.virtualChallengeId : concreteChallengeId
const taskLoadMethod = ownProps.user?.properties.mr3Frontend?.settings?.loadMethod || TaskLoadMethod.random
const taskLoadMethod = ownProps.user?.properties?.mr3Frontend?.settings?.loadMethod || TaskLoadMethod.random
const mappedProps = {}

if (_isFinite(challengeId)) {
Expand Down

0 comments on commit 513a920

Please sign in to comment.