Skip to content

Commit

Permalink
Adds optional chaining. (mattermost#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkraft authored and hmhealey committed Jun 26, 2019
1 parent 86146ba commit 6192972
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
plugins: [
'@babel/transform-flow-comments',
'@babel/proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
['module-resolver', {
root: ['./src', '.'],
}],
Expand Down
21 changes: 20 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@babel/cli": "7.4.4",
"@babel/core": "7.4.5",
"@babel/plugin-proposal-class-properties": "7.4.4",
"@babel/plugin-proposal-optional-chaining": "^7.2.0",
"@babel/plugin-transform-flow-comments": "7.4.4",
"@babel/preset-env": "7.2.0",
"@babel/register": "7.4.4",
Expand Down
4 changes: 2 additions & 2 deletions src/selectors/entities/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export function getGroupMembers(state, id) {
return groupMemberData.members;
}

const teamGroupIDs = (state, teamID) => state.entities.teams.groupsAssociatedToTeam[teamID].ids || [];
const teamGroupIDs = (state, teamID) => state.entities.teams.groupsAssociatedToTeam[teamID]?.ids || [];

const channelGroupIDs = (state, channelID) => state.entities.channels.groupsAssociatedToChannel[channelID].ids || [];
const channelGroupIDs = (state, channelID) => state.entities.channels.groupsAssociatedToChannel[channelID]?.ids || [];

const getTeamGroupIDSet = createSelector(
teamGroupIDs,
Expand Down

0 comments on commit 6192972

Please sign in to comment.