Skip to content

Commit 8852abb

Browse files
committed
Add retry links to failed actions
1 parent 3e5c97d commit 8852abb

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/components/CreateGist.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class CreateGist extends Component {
3030
Create Gist
3131
</button>
3232
{createGistStatus.pending && 'Creating gist...'}
33+
{createGistStatus.failed && 'An error occurred while creating the gist.'}
3334
</div>
3435
<div className="Gist-description">
3536
<div className="Gist-descriptionLabel">

src/components/Gist.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ class Gist extends Component {
2727
return (
2828
<div className="Gist">
2929
{readGistStatus.pending && ('Loading gist...')}
30-
{readGistStatus.failed && !gistNotFound && ('There was an error while retrieving this gist')}
30+
{readGistStatus.failed && !gistNotFound && (
31+
<span>
32+
There was an error while retrieving this gist. <button onClick={this.readGist}>Try again.</button>
33+
</span>
34+
)}
3135
{readGistStatus.failed && gistNotFound && ('This gist could not be found.')}
3236
{readGistStatus.succeeded && (
3337
<form>

src/components/Gists.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ class Gists extends Component {
1616
return (
1717
<div className="Gists">
1818
{usersGistsStatus.pending && ('Loading gists...')}
19-
{usersGistsStatus.failed && ('There was an error loading gists.')}
19+
{usersGistsStatus.failed && (
20+
<span>
21+
There was an error loading gists. <button onClick={this.fetchUsersGists}>Try again.</button>
22+
</span>
23+
)}
2024
{usersGistsStatus.succeeded && (
2125
<ul className="Gists-list">
2226
{usersGists.map(gist => (

0 commit comments

Comments
 (0)