1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

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> </div>
</template> </template>
<style type="text/css" scoped> <style type="text/css" scoped>
.o-square { .o-square {
max-width: 320px; max-width: 320px;
} }
.o-portrait { .o-portrait {
max-width: 320px; max-width: 320px;
} }
.o-landscape { .o-landscape {
max-width: 320px; max-width: 320px;
} }
.post-icon { .post-icon {
color: #fff; color: #fff;
position:relative; position:relative;
margin-top: 10px; margin-top: 10px;
z-index: 9; z-index: 9;
opacity: 0.6; opacity: 0.6;
text-shadow: 3px 3px 16px #272634; text-shadow: 3px 3px 16px #272634;
} }
.font-size-16px { .font-size-16px {
font-size: 16px; font-size: 16px;
} }
.profile-website { .profile-website {
color: #003569; color: #003569;
text-decoration: none; text-decoration: none;
font-weight: 600; font-weight: 600;
} }
.nav-topbar .nav-link { .nav-topbar .nav-link {
color: #999; color: #999;
} }
.nav-topbar .nav-link .small { .nav-topbar .nav-link .small {
font-weight: 600; font-weight: 600;
} }
</style> </style>
<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;