mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-11 16:35:09 +01:00
Merge pull request #140 from h3poteto/ref_modal
Refactor changeModal of NewTootModal
This commit is contained in:
commit
d205e53fe1
@ -61,7 +61,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close () {
|
close () {
|
||||||
this.$store.commit('TimelineSpace/NewTootModal/changeModal', false)
|
this.$store.dispatch('TimelineSpace/NewTootModal/changeModal', false)
|
||||||
},
|
},
|
||||||
keydown (e) {
|
keydown (e) {
|
||||||
if (e.keyCode === 17 || e.keyCode === 93) {
|
if (e.keyCode === 17 || e.keyCode === 93) {
|
||||||
@ -97,6 +97,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$store.dispatch('TimelineSpace/NewTootModal/postToot', form)
|
this.$store.dispatch('TimelineSpace/NewTootModal/postToot', form)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
this.close()
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'Toot',
|
message: 'Toot',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
|
@ -32,9 +32,6 @@ const NewTootModal = {
|
|||||||
)
|
)
|
||||||
client.post('/statuses', form, (err, data, res) => {
|
client.post('/statuses', form, (err, data, res) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
commit('changeModal', false)
|
|
||||||
commit('setReplyTo', null)
|
|
||||||
commit('updateStatus', '')
|
|
||||||
resolve(res)
|
resolve(res)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -45,11 +42,11 @@ const NewTootModal = {
|
|||||||
commit('changeModal', true)
|
commit('changeModal', true)
|
||||||
},
|
},
|
||||||
changeModal ({ commit }, value) {
|
changeModal ({ commit }, value) {
|
||||||
commit('changeModal', value)
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
commit('updateStatus', '')
|
commit('updateStatus', '')
|
||||||
commit('setReplyTo', null)
|
commit('setReplyTo', null)
|
||||||
}
|
}
|
||||||
|
commit('changeModal', value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user