forked from mirror/pixelfed
Update Timeline component, change api endpoint
This commit is contained in:
parent
0cc1365f98
commit
b78a51890d
|
@ -450,7 +450,7 @@
|
||||||
replyStatus: {},
|
replyStatus: {},
|
||||||
replyText: '',
|
replyText: '',
|
||||||
replyNsfw: false,
|
replyNsfw: false,
|
||||||
emoji: window.App.util.emoji,
|
emoji: [],
|
||||||
showHashtagPosts: false,
|
showHashtagPosts: false,
|
||||||
hashtagPosts: [],
|
hashtagPosts: [],
|
||||||
hashtagPostsName: '',
|
hashtagPostsName: '',
|
||||||
|
@ -514,21 +514,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
// let avop = window.localStorage.getItem('pf.feed:avop') === 'always';
|
|
||||||
// let u = new URLSearchParams(window.location.search);
|
|
||||||
// if(u.has('a')) {
|
|
||||||
// switch(u.get('a')) {
|
|
||||||
// case 'recent_feed':
|
|
||||||
// if(this.scope === 'home') {
|
|
||||||
// this.recentFeed = true;
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// case 'vop':
|
|
||||||
// this.recentFeed = false;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// this.recentFeed = avop ? false : this.recentFeed;
|
|
||||||
this.fetchProfile();
|
this.fetchProfile();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -589,17 +574,13 @@
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
fetchProfile() {
|
fetchProfile() {
|
||||||
axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => {
|
axios.get('/api/v1/accounts/verify_credentials').then(res => {
|
||||||
this.profile = res.data;
|
this.profile = res.data;
|
||||||
if(this.profile.is_admin == true) {
|
if(this.profile.is_admin == true) {
|
||||||
this.modes.mod = true;
|
this.modes.mod = true;
|
||||||
}
|
}
|
||||||
window._sharedData.curUser = res.data;
|
window._sharedData.curUser = res.data;
|
||||||
window.App.util.navatar();
|
window.App.util.navatar();
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.hasStory();
|
|
||||||
// });
|
|
||||||
// this.expRec();
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal(
|
swal(
|
||||||
'Oops, something went wrong',
|
'Oops, something went wrong',
|
||||||
|
@ -633,7 +614,7 @@
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
|
|
||||||
if(!data.length) {
|
if(!data || !data.length) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.emptyFeed = true;
|
this.emptyFeed = true;
|
||||||
return;
|
return;
|
||||||
|
@ -651,32 +632,15 @@
|
||||||
this.min_id = Math.max(...ids).toString();
|
this.min_id = Math.max(...ids).toString();
|
||||||
this.max_id = Math.min(...ids).toString();
|
this.max_id = Math.min(...ids).toString();
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
// $('.timeline .pagination').removeClass('d-none');
|
|
||||||
|
|
||||||
// if(this.hashtagPosts.length == 0) {
|
|
||||||
// this.fetchHashtagPosts();
|
|
||||||
// }
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.hasStory();
|
this.hasStory();
|
||||||
});
|
});
|
||||||
// this.fetchStories();
|
|
||||||
// this.rtw();
|
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) {
|
document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) {
|
||||||
i.href = App.util.format.rewriteLinks(i);
|
i.href = App.util.format.rewriteLinks(i);
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
// axios.get('/api/pixelfed/v2/discover/posts/trending', {
|
|
||||||
// params: {
|
|
||||||
// range: 'daily'
|
|
||||||
// }
|
|
||||||
// }).then(res => {
|
|
||||||
// let data = res.data.filter(post => this.ids.indexOf(post.id) === -1);
|
|
||||||
// this.discover_feed = data;
|
|
||||||
// });
|
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal(
|
swal(
|
||||||
'Oops, something went wrong',
|
'Oops, something went wrong',
|
||||||
|
@ -915,11 +879,6 @@
|
||||||
}
|
}
|
||||||
$('.postCommentsLoader').addClass('d-none');
|
$('.postCommentsLoader').addClass('d-none');
|
||||||
$('.postCommentsContainer').removeClass('d-none');
|
$('.postCommentsContainer').removeClass('d-none');
|
||||||
// setTimeout(function() {
|
|
||||||
// document.querySelectorAll('.status-comment .postCommentsContainer .comment-body a').forEach(function(i, e) {
|
|
||||||
// i.href = App.util.format.rewriteLinks(i);
|
|
||||||
// });
|
|
||||||
// }, 500);
|
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if(!error.response) {
|
if(!error.response) {
|
||||||
$('.postCommentsLoader .lds-ring')
|
$('.postCommentsLoader .lds-ring')
|
||||||
|
|
Loading…
Reference in New Issue