fix JS warnings on PostHeader and EditChannelInfo (#1541)
This commit is contained in:
parent
579494feab
commit
217c98cab6
2 changed files with 6 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue