1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-31 09:35:16 +01:00

Merge pull request #784 from amyspark/prevent-multiple-toots

Prevent multiple toot submissions
This commit is contained in:
AkiraFukushima 2018-12-14 08:53:37 +09:00 committed by GitHub
commit 2bbb607c54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,6 +95,10 @@ const NewToot = {
if (rootState.TimelineSpace.account.accessToken === undefined || rootState.TimelineSpace.account.accessToken === null) {
throw new AuthenticationError()
}
if (state.blockSubmit) {
return
}
commit('changeBlockSubmit', true)
const client = new Mastodon(
rootState.TimelineSpace.account.accessToken,
rootState.TimelineSpace.account.baseURL + '/api/v1'
@ -104,6 +108,9 @@ const NewToot = {
ipcRenderer.send('toot-action-sound')
return res.data
})
.finally(() => {
commit('changeBlockSubmit', false)
})
},
openReply ({ dispatch, commit, rootState }, message) {
commit('setReplyTo', message)