@@ -119,11 +120,10 @@ export default {
step: 1,
title: '',
description: '',
- visibility: 'private',
collection: {
title: '',
description: '',
- visibility: 'public'
+ visibility: 'draft'
},
id: '',
posts: [],
@@ -188,11 +188,16 @@ export default {
swal('Invalid URL', 'You can only add posts from this instance', 'error');
this.id = '';
}
- if(url.slice(0, origin.length + 3) !== origin + '/p/' || split.length !== 6) {
+
+ if(url.includes('/i/web/post/') || url.includes('/p/')) {
+ let id = split[split.length - 1];
+ console.log('adding ' + id);
+ this.addToIds(id);
+ return;
+ } else {
swal('Invalid URL', 'Invalid URL', 'error');
this.id = '';
- }
- this.addToIds(split[5]);
+ }
return;
},
@@ -206,10 +211,11 @@ export default {
},
fetchRecentPosts() {
- axios.get('/api/pixelfed/v1/accounts/' + this.profileId + '/statuses', {
+ axios.get('/api/v1/accounts/' + this.profileId + '/statuses', {
params: {
only_media: true,
min_id: 1,
+ limit: 40
}
}).then(res => {
this.recentPosts = res.data.filter(s => {
@@ -217,7 +223,7 @@ export default {
return s.id;
});
return s.visibility == 'public' && s.sensitive == false && ids.indexOf(s.id) == -1;
- }).slice(0,3);
+ });
});
},
@@ -237,7 +243,7 @@ export default {
visibility: this.collection.visibility
})
.then(res => {
- window.location.href = res.data;
+ window.location.href = res.data.url;
}).catch(err => {
swal('Something went wrong', 'There was a problem with your request, please try again later.', 'error');
});
@@ -266,4 +272,4 @@ export default {
}
}
}
-
\ No newline at end of file
+