1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-24 00:35:59 +00:00

Update Timeline.vue

This commit is contained in:
Daniel Supernault 2019-05-02 21:11:28 -06:00
parent e0b3866b41
commit de0fef8fa0
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -419,6 +419,9 @@
fetchProfile() {
axios.get('/api/v1/accounts/verify_credentials').then(res => {
this.profile = res.data;
if(this.profile.is_admin == true) {
this.modes.mod = true;
}
$('.profile-card .loader').addClass('d-none');
$('.profile-card .contents').removeClass('d-none');
$('.profile-card .card-footer').removeClass('d-none');
@ -653,7 +656,7 @@
},
deletePost(status, index) {
if($('body').hasClass('loggedIn') == false || status.account.id !== this.profile.id) {
if($('body').hasClass('loggedIn') == false || this.ownerOrAdmin(status) == false) {
return;
}
@ -834,12 +837,12 @@
modeModToggle() {
this.modes.mod = !this.modes.mod;
window.ls.set('pixelfed-classicui-settings', this.modes);
//window.ls.set('pixelfed-classicui-settings', this.modes);
},
modeNotifyToggle() {
this.modes.notify = !this.modes.notify;
window.ls.set('pixelfed-classicui-settings', this.modes);
//window.ls.set('pixelfed-classicui-settings', this.modes);
},
modeDarkToggle() {
@ -863,12 +866,12 @@
this.modes.dark = true;
});
}
window.ls.set('pixelfed-classicui-settings', this.modes);
//window.ls.set('pixelfed-classicui-settings', this.modes);
},
modeInfiniteToggle() {
this.modes.infinite = !this.modes.infinite
window.ls.set('pixelfed-classicui-settings', this.modes);
//window.ls.set('pixelfed-classicui-settings', this.modes);
},
followingModal() {
@ -991,6 +994,18 @@
this.following.splice(index, 1);
}
})
},
owner(status) {
return this.profile.id === status.account.id;
},
admin() {
return this.profile.is_admin == true;
},
ownerOrAdmin(status) {
return this.owner(status) || this.admin();
}
}
}