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

@ -474,42 +474,42 @@
</div>
</template>
<style type="text/css" scoped>
.o-square {
.o-square {
max-width: 320px;
}
.o-portrait {
}
.o-portrait {
max-width: 320px;
}
.o-landscape {
}
.o-landscape {
max-width: 320px;
}
.post-icon {
}
.post-icon {
color: #fff;
position:relative;
margin-top: 10px;
z-index: 9;
opacity: 0.6;
text-shadow: 3px 3px 16px #272634;
}
.font-size-16px {
}
.font-size-16px {
font-size: 16px;
}
.profile-website {
}
.profile-website {
color: #003569;
text-decoration: none;
font-weight: 600;
}
.nav-topbar .nav-link {
}
.nav-topbar .nav-link {
color: #999;
}
.nav-topbar .nav-link .small {
}
.nav-topbar .nav-link .small {
font-weight: 600;
}
}
</style>
<script type="text/javascript">
import VueMasonry from 'vue-masonry-css'
Vue.use(VueMasonry);
export default {
props: [
'profile-id',
@ -557,6 +557,7 @@
this.fetchProfile();
let u = new URLSearchParams(window.location.search);
if(u.has('ui') && u.get('ui') == 'moment' && this.layout != 'moment') {
Vue.use(VueMasonry);
this.layout = 'moment';
}
if(u.has('ui') && u.get('ui') == 'metro' && this.layout != 'metro') {
@ -581,6 +582,11 @@
if(u.has('md') && u.get('md') == 'following') {
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() {
@ -591,12 +597,12 @@
fetchProfile() {
axios.get('/api/v1/accounts/' + this.profileId).then(res => {
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';
axios.get(apiUrl, {
params: {
@ -614,7 +620,7 @@
this.timeline = data;
this.ownerCheck();
this.loading = false;
this.loadSponsor();
//this.loadSponsor();
}).catch(err => {
swal('Oops, something went wrong',
'Please release the page.',
@ -825,7 +831,6 @@
});
},
unmuteProfile(status = null) {
if($('body').hasClass('loggedIn') == false) {
return;