Update Profile.vue component

This commit is contained in:
Daniel Supernault 2019-09-12 22:38:29 -06:00
parent 9195ba45b9
commit f736070b91
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -509,7 +509,7 @@
<script type="text/javascript"> <script type="text/javascript">
import VueMasonry from 'vue-masonry-css' import VueMasonry from 'vue-masonry-css'
Vue.use(VueMasonry);
export default { export default {
props: [ props: [
'profile-id', 'profile-id',
@ -557,6 +557,7 @@
this.fetchProfile(); this.fetchProfile();
let u = new URLSearchParams(window.location.search); let u = new URLSearchParams(window.location.search);
if(u.has('ui') && u.get('ui') == 'moment' && this.layout != 'moment') { if(u.has('ui') && u.get('ui') == 'moment' && this.layout != 'moment') {
Vue.use(VueMasonry);
this.layout = 'moment'; this.layout = 'moment';
} }
if(u.has('ui') && u.get('ui') == 'metro' && this.layout != 'metro') { if(u.has('ui') && u.get('ui') == 'metro' && this.layout != 'metro') {
@ -581,6 +582,11 @@
if(u.has('md') && u.get('md') == 'following') { if(u.has('md') && u.get('md') == 'following') {
this.followingModal(); this.followingModal();
} }
if(document.querySelectorAll('body')[0].classList.contains('loggedIn') == true) {
axios.get('/api/v1/accounts/verify_credentials').then(res => {
this.user = res.data;
});
}
}, },
updated() { updated() {
@ -591,12 +597,12 @@
fetchProfile() { fetchProfile() {
axios.get('/api/v1/accounts/' + this.profileId).then(res => { axios.get('/api/v1/accounts/' + this.profileId).then(res => {
this.profile = res.data; this.profile = res.data;
}).then(res => {
this.fetchPosts();
}); });
if(document.querySelectorAll('body')[0].classList.contains('loggedIn') == true) { },
axios.get('/api/v1/accounts/verify_credentials').then(res => {
this.user = res.data; fetchPosts() {
});
}
let apiUrl = '/api/v1/accounts/' + this.profileId + '/statuses'; let apiUrl = '/api/v1/accounts/' + this.profileId + '/statuses';
axios.get(apiUrl, { axios.get(apiUrl, {
params: { params: {
@ -614,7 +620,7 @@
this.timeline = data; this.timeline = data;
this.ownerCheck(); this.ownerCheck();
this.loading = false; this.loading = false;
this.loadSponsor(); //this.loadSponsor();
}).catch(err => { }).catch(err => {
swal('Oops, something went wrong', swal('Oops, something went wrong',
'Please release the page.', 'Please release the page.',
@ -825,7 +831,6 @@
}); });
}, },
unmuteProfile(status = null) { unmuteProfile(status = null) {
if($('body').hasClass('loggedIn') == false) { if($('body').hasClass('loggedIn') == false) {
return; return;