Skip to content

Commit

Permalink
Disable the submit button during submission
Browse files Browse the repository at this point in the history
  • Loading branch information
hackjutsu committed Feb 12, 2017
1 parent 31b967f commit 6aaa5ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
24 changes: 12 additions & 12 deletions app/containers/snippet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,18 @@ class Snippet extends Component {
// response, which provides better user experience.
this.closeGistEditorModal()

getGitHubApi(EDIT_SINGLE_GIST)(
this.props.accessToken,
this.props.activeGist,
description,
processedFiles)
.catch((err) => {
Notifier('Gist update failed')
logger.error(JSON.stringify(err))
})
.then((response) => {
this.updateGistsStoreWithUpdatedGist(response)
})
return getGitHubApi(EDIT_SINGLE_GIST)(
this.props.accessToken,
this.props.activeGist,
description,
processedFiles)
.catch((err) => {
Notifier('Gist update failed')
logger.error(JSON.stringify(err))
})
.then((response) => {
this.updateGistsStoreWithUpdatedGist(response)
})
}

updateGistsStoreWithUpdatedGist (gistDetails) {
Expand Down
22 changes: 11 additions & 11 deletions app/containers/userPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ class UserPanel extends Component {
}
})

getGitHubApi(CREATE_SINGLE_GIST)(this.props.accessToken, description, processedFiles, isPublic)
.catch((err) => {
Notifier('Gist creation failed')
logger.error(JSON.stringify(err))
})
.then((response) => {
this.updateGistsStoreWithNewGist(response)
})
.finally(() => {
this.closeGistEditorModal()
})
return getGitHubApi(CREATE_SINGLE_GIST)(this.props.accessToken, description, processedFiles, isPublic)
.catch((err) => {
Notifier('Gist creation failed')
logger.error(JSON.stringify(err))
})
.then((response) => {
this.updateGistsStoreWithNewGist(response)
})
.finally(() => {
this.closeGistEditorModal()
})
}

updateGistsStoreWithNewGist (gistDetails) {
Expand Down

0 comments on commit 6aaa5ba

Please sign in to comment.