2019-09-20 03:27:37 +10:00
|
|
|
import PostStatusForm from '../post_status_form/post_status_form.vue'
|
|
|
|
|
|
|
|
const PostStatusModal = {
|
|
|
|
components: {
|
|
|
|
PostStatusForm
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isLoggedIn () {
|
|
|
|
return !!this.$store.state.users.currentUser
|
|
|
|
},
|
|
|
|
isOpen () {
|
|
|
|
return this.isLoggedIn && this.$store.state.postStatus.modalActivated
|
|
|
|
},
|
|
|
|
params () {
|
|
|
|
return this.$store.state.postStatus.params
|
|
|
|
}
|
|
|
|
},
|
2019-09-20 03:52:54 +10:00
|
|
|
watch: {
|
|
|
|
isOpen (val) {
|
|
|
|
if (val) {
|
|
|
|
this.$nextTick(() => this.$el.querySelector('textarea').focus())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-09-20 03:27:37 +10:00
|
|
|
methods: {
|
|
|
|
closeModal () {
|
|
|
|
this.$store.dispatch('closePostStatusModal')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PostStatusModal
|