aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-07-16 10:18:18 +0300
committerShpuld Shpuldson <shp@cock.li>2020-07-16 10:18:18 +0300
commit0c7c24d3d1e4580d6ce03f71b9381aa3f6b689cb (patch)
treee5bc1daee93fd68a1ca15f6da946839242279e9b
parent89a677f5e822456f0e8ec510ed6193a8e1783297 (diff)
make idempotency watch entire status
-rw-r--r--src/components/post_status_form/post_status_form.js16
-rw-r--r--src/services/status_poster/status_poster.service.js5
2 files changed, 9 insertions, 12 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 29841261..c70c2232 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -208,14 +208,18 @@ const PostStatusForm = {
})
},
watch: {
- 'newStatus.contentType': function () {
- this.autoPreview()
- },
- 'newStatus.spoilerText': function () {
- this.autoPreview()
+ 'newStatus': {
+ deep: true,
+ handler () {
+ this.statusChanged()
+ }
}
},
methods: {
+ statusChanged () {
+ this.autoPreview()
+ this.updateIdempotencyKey()
+ },
clearStatus () {
const newStatus = this.newStatus
this.newStatus = {
@@ -239,7 +243,6 @@ const PostStatusForm = {
el.style.height = 'auto'
el.style.height = undefined
this.error = null
- this.updateIdempotencyKey()
if (this.preview) this.previewStatus()
},
async postStatus (event, newStatus, opts = {}) {
@@ -407,7 +410,6 @@ const PostStatusForm = {
}
},
onEmojiInputInput (e) {
- this.autoPreview()
this.$nextTick(() => {
this.resize(this.$refs['textarea'])
})
diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js
index 812f74d5..f09196aa 100644
--- a/src/services/status_poster/status_poster.service.js
+++ b/src/services/status_poster/status_poster.service.js
@@ -30,10 +30,6 @@ const postStatus = ({
idempotencyKey
})
.then((data) => {
- return {
- error: 'test'
- }
- /*
if (!data.error && !preview) {
store.dispatch('addNewStatuses', {
statuses: [data],
@@ -43,7 +39,6 @@ const postStatus = ({
})
}
return data
- */
})
.catch((err) => {
return {