1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2024-12-23 23:47:57 +01:00

Merge pull request #140 from h3poteto/ref_modal

Refactor changeModal of NewTootModal
This commit is contained in:
AkiraFukushima 2018-03-26 20:52:11 +09:00 committed by GitHub
commit d205e53fe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -61,7 +61,7 @@ export default {
},
methods: {
close () {
this.$store.commit('TimelineSpace/NewTootModal/changeModal', false)
this.$store.dispatch('TimelineSpace/NewTootModal/changeModal', false)
},
keydown (e) {
if (e.keyCode === 17 || e.keyCode === 93) {
@ -97,6 +97,7 @@ export default {
}
this.$store.dispatch('TimelineSpace/NewTootModal/postToot', form)
.then(() => {
this.close()
this.$message({
message: 'Toot',
type: 'success'

View File

@ -32,9 +32,6 @@ const NewTootModal = {
)
client.post('/statuses', form, (err, data, res) => {
if (err) return reject(err)
commit('changeModal', false)
commit('setReplyTo', null)
commit('updateStatus', '')
resolve(res)
})
})
@ -45,11 +42,11 @@ const NewTootModal = {
commit('changeModal', true)
},
changeModal ({ commit }, value) {
commit('changeModal', value)
if (!value) {
commit('updateStatus', '')
commit('setReplyTo', null)
}
commit('changeModal', value)
}
}
}