diff --git a/resources/assets/js/components/ComposeModal.vue b/resources/assets/js/components/ComposeModal.vue
index 17b8e7359..e81241762 100644
--- a/resources/assets/js/components/ComposeModal.vue
+++ b/resources/assets/js/components/ComposeModal.vue
@@ -37,7 +37,11 @@
Add Photo
-
{{composeMessage()}}
+
+
{{composeMessage()}}
+
Accepted Formats: {{acceptedFormats()}}
+
Max File Size: {{maxSize()}}
+
@@ -173,19 +177,20 @@
{{composeText.length}} / {{config.uploader.max_caption_length}}
+ -->
+
@@ -218,11 +223,7 @@
export default {
data() {
return {
- config: {
- uploader: {
- media_types: '',
- }
- },
+ config: window.App.config,
profile: {},
composeText: '',
composeTextLength: 0,
@@ -241,7 +242,6 @@ export default {
},
beforeMount() {
- this.fetchConfig();
this.fetchProfile();
},
@@ -290,20 +290,10 @@ export default {
['Willow','filter-willow'],
['X-Pro II','filter-xpro-ii']
];
-
+ console.log(this.config);
},
methods: {
-
- fetchConfig() {
- axios.get('/api/v2/config').then(res => {
- this.config = res.data;
- if(this.config.uploader.media_types.includes('video/mp4') == false) {
- this.composeType = 'post'
- }
- });
- },
-
fetchProfile() {
axios.get('/api/v1/accounts/verify_credentials').then(res => {
this.profile = res.data;
@@ -464,6 +454,11 @@ export default {
let data = res.data;
window.location.href = data;
}).catch(err => {
+ let res = err.response.data;
+ if(res.message == 'Too Many Attempts.') {
+ swal('You\'re posting too much!', 'We only allow 50 posts per hour or 100 per day. If you\'ve reached that limit, please try again later. If you think this is an error, please contact an administrator.', 'error');
+ return;
+ }
swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error');
});
return;
@@ -511,6 +506,18 @@ export default {
createCollection() {
window.location.href = '/i/collections/create';
+ },
+
+ maxSize() {
+ let limit = this.config.uploader.max_photo_size;
+ return limit / 1000 + ' MB';
+ },
+
+ acceptedFormats() {
+ let formats = this.config.uploader.media_types;
+ return formats.split(',').map(f => {
+ return ' ' + f.split('/')[1];
+ }).toString();
}
}
}