aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/post_status_form/post_status_form.js21
-rw-r--r--src/components/post_status_form/post_status_form.vue10
2 files changed, 24 insertions, 7 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index c0970263..6b78b7dd 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -39,6 +39,7 @@ const PostStatusForm = {
return {
dropFiles: [],
submitDisabled: false,
+ error: null,
newStatus: {
status: statusText,
files: []
@@ -90,14 +91,20 @@ const PostStatusForm = {
media: newStatus.files,
store: this.$store,
inReplyToStatusId: this.replyTo
+ }).then((data) => {
+ if (!data.error) {
+ this.newStatus = {
+ status: '',
+ files: []
+ }
+ this.$emit('posted')
+ let el = this.$el.querySelector('textarea')
+ el.style.height = '16px'
+ this.error = null
+ } else {
+ this.error = data.error
+ }
})
- this.newStatus = {
- status: '',
- files: []
- }
- this.$emit('posted')
- let el = this.$el.querySelector('textarea')
- el.style.height = '16px'
},
addMediaFile (fileInfo) {
this.newStatus.files.push(fileInfo)
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index a17d6479..e1e3e4be 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -19,6 +19,9 @@
<media-upload @uploading="disableSubmit" @uploaded="addMediaFile" @upload-failed="enableSubmit" :drop-files="dropFiles"></media-upload>
<button :disabled="submitDisabled" type="submit" class="btn btn-default base05 base01-background">Submit</button>
</div>
+ <div class='error' v-if="error">
+ Error: {{ error }}
+ </div>
<div class="attachments">
<div class="attachment" v-for="file in newStatus.files">
<i class="fa icon-cancel" @click="removeMediaFile(file)"></i>
@@ -61,6 +64,13 @@
width: 10em;
}
}
+ .error {
+ border-radius: 5px;
+ text-align: center;
+ background-color: rgba(255, 48, 16, 0.65);
+ padding: 0.25em;
+ margin: 0.35em;
+ }
.attachments {
padding: 0 0.5em;