aboutsummaryrefslogtreecommitdiff
path: root/src/components/post_status_modal/post_status_modal.js
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-09-26 21:14:31 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-09-26 21:14:31 +0300
commit19cb98b85fc071dccd88bcdddff75d99cd4d944d (patch)
treea99d9ed2ab174eea4533146b8f97c6bde9170eae /src/components/post_status_modal/post_status_modal.js
parentc02433b7e69d4e19be50cb513327a8985f262998 (diff)
parent501208d350a9bd0fbcafb13d70a2fa6182fb8cf3 (diff)
Merge branch 'develop' into feature/following_reblogs
Diffstat (limited to 'src/components/post_status_modal/post_status_modal.js')
-rw-r--r--src/components/post_status_modal/post_status_modal.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js
new file mode 100644
index 00000000..1033ba11
--- /dev/null
+++ b/src/components/post_status_modal/post_status_modal.js
@@ -0,0 +1,32 @@
+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 || {}
+ }
+ },
+ watch: {
+ isOpen (val) {
+ if (val) {
+ this.$nextTick(() => this.$el.querySelector('textarea').focus())
+ }
+ }
+ },
+ methods: {
+ closeModal () {
+ this.$store.dispatch('closePostStatusModal')
+ }
+ }
+}
+
+export default PostStatusModal