fix JS warnings on PostHeader and EditChannelInfo (#1541)

This commit is contained in:
Saturnino Abril 2018-03-26 21:29:22 +08:00 committed by GitHub
parent 579494feab
commit 217c98cab6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -34,7 +34,7 @@ export default class EditChannelInfo extends PureComponent {
enableRightButton: PropTypes.func,
saving: PropTypes.bool.isRequired,
editing: PropTypes.bool,
error: PropTypes.string,
error: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
displayName: PropTypes.string,
currentTeamUrl: PropTypes.string,
channelURL: PropTypes.string,

View file

@ -25,7 +25,7 @@ export default class PostHeader extends PureComponent {
commentCount: PropTypes.number,
commentedOnDisplayName: PropTypes.string,
createAt: PropTypes.number.isRequired,
displayName: PropTypes.string.isRequired,
displayName: PropTypes.string,
enablePostUsernameOverride: PropTypes.bool,
fromWebHook: PropTypes.bool,
isPendingOrFailedPost: PropTypes.bool,
@ -39,7 +39,7 @@ export default class PostHeader extends PureComponent {
shouldRenderReplyButton: PropTypes.bool,
showFullDate: PropTypes.bool,
theme: PropTypes.object.isRequired,
username: PropTypes.string.isRequired,
username: PropTypes.string,
isFlagged: PropTypes.bool,
};
@ -50,7 +50,9 @@ export default class PostHeader extends PureComponent {
};
handleUsernamePress = () => {
this.props.onUsernamePress(this.props.username);
if (this.props.username) {
this.props.onUsernamePress(this.props.username);
}
}
getDisplayName = (style) => {