diff --git a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js index ce957b82d..0e7cbe347 100644 --- a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js +++ b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js @@ -397,6 +397,13 @@ class ModerationQueue extends React.Component { const index = comments.findIndex( comment => comment.id === selectedCommentId ); + + // This can happen temporarily when we call redux to change the selected comment + // but it didn't fully take effect yet. + if (index === -1) { + return null; + } + const comment = comments[index]; return (
@@ -414,7 +421,7 @@ class ModerationQueue extends React.Component { dangling={ !this.props.commentBelongToQueue(this.props.activeTab, comment) } - />; + />
); } diff --git a/client/coral-admin/src/routes/Stories/components/Stories.css b/client/coral-admin/src/routes/Stories/components/Stories.css index e8e2b8474..63a05ab6a 100644 --- a/client/coral-admin/src/routes/Stories/components/Stories.css +++ b/client/coral-admin/src/routes/Stories/components/Stories.css @@ -56,6 +56,7 @@ width: 100%; border-left: none; border-right: none; + white-space: pre-wrap; a { color: rgb(44, 44, 44); diff --git a/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js b/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js index bc673ba28..002297415 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js +++ b/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js @@ -8,6 +8,7 @@ import ClickOutside from 'coral-framework/components/ClickOutside'; import cn from 'classnames'; import styles from './FlagButton.css'; import * as REASONS from 'coral-framework/graphql/flagReasons'; +import PropTypes from 'prop-types'; import { getErrorMessages, forEachError } from 'coral-framework/utils'; @@ -77,9 +78,10 @@ export default class FlagButton extends Component { return; } break; - case this.props.getPopupMenu.length: - this.closeMenu(); - return; + case 2: + return this.closeMenu(); + default: + throw new Error(`Unexpected step ${step}`); } // If itemType and reason are both set, post the action @@ -92,6 +94,8 @@ export default class FlagButton extends Component { case 'USERS': item_id = author_id; break; + default: + throw new Error(`Unexpected itemType ${itemType}`); } let action = { @@ -272,3 +276,12 @@ export default class FlagButton extends Component { ); } } + +FlagButton.propTypes = { + currentUser: PropTypes.object, + showSignInDialog: PropTypes.func, + notify: PropTypes.func, + getPopupMenu: PropTypes.array, + flaggedByCurrentUser: PropTypes.bool, + banned: PropTypes.bool, +}; diff --git a/package.json b/package.json index 6a3b1b447..1c801db93 100644 --- a/package.json +++ b/package.json @@ -218,7 +218,7 @@ "yaml-lint": "^1.0.0" }, "engines": { - "node": "^8" + "node": ">=8" }, "pre-commit": { "silent": false,