diff options
| author | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-29 12:36:36 +0500 |
|---|---|---|
| committer | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-29 12:36:36 +0500 |
| commit | 529d009d93eda1ab83c92c4a8537832856b3a5c6 (patch) | |
| tree | 96745bfac664b4fc43f8bcd4dab0875858e2248d /src/containers | |
| parent | Save options functionality (diff) | |
| download | githunt-529d009d93eda1ab83c92c4a8537832856b3a5c6.tar.gz | |
Update options message
Diffstat (limited to 'src/containers')
| -rw-r--r-- | src/containers/feed/index.js | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/containers/feed/index.js b/src/containers/feed/index.js index b33e192..20a8913 100644 --- a/src/containers/feed/index.js +++ b/src/containers/feed/index.js @@ -87,9 +87,27 @@ class FeedContainer extends React.Component { } renderErrors() { - return this.props.github.error && ( + if (!this.props.github.error) { + return null; + } + + let message = ''; + switch (this.props.github.error.toLowerCase()) { + case 'bad credentials': + message = ( + <span> + Token is invalid, try <Link to='/options'>updating the token</Link> on the options page + </span> + ); + break; + default: + message = this.props.github.error; + break; + } + + return ( <Alert type='danger'> - { this.props.github.error } + { message } </Alert> ); } |
