Update Profile.vue component

This commit is contained in:
Daniel Supernault 2019-08-22 21:22:46 -06:00
parent d9db1cf8b1
commit ac9bb59e19
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -187,11 +187,11 @@
</div> </div>
</a> </a>
</div> </div>
</div> <div v-if="timeline.length == 0" class="col-12">
<div v-if="mode == 'grid' != -1 && timeline.length == 0"> <div class="py-5 text-center text-muted">
<div class="py-5 text-center text-muted"> <p><i class="fas fa-camera-retro fa-2x"></i></p>
<p><i class="fas fa-camera-retro fa-2x"></i></p> <p class="h2 font-weight-light pt-3">No posts yet</p>
<p class="h2 font-weight-light pt-3">No posts yet</p> </div>
</div> </div>
</div> </div>
<div v-if="timeline.length && mode == 'grid'"> <div v-if="timeline.length && mode == 'grid'">
@ -290,10 +290,10 @@
</span> </span>
<span v-if="profile.id != user.id && user.hasOwnProperty('id')"> <span v-if="profile.id != user.id && user.hasOwnProperty('id')">
<span class="pl-md-4 pl-sm-2" v-if="relationship.following == true"> <span class="pl-md-4 pl-sm-2" v-if="relationship.following == true">
<button type="button" class="btn btn-outline-secondary font-weight-bold btn-sm" @click.prevent="followProfile()" data-toggle="tooltip" title="Unfollow">Unfollow</button> <button type="button" class="btn btn-outline-secondary font-weight-bold btn-sm" @click.prevent="followProfile()">Unfollow</button>
</span> </span>
<span class="pl-md-4 pl-sm-2" v-else> <span class="pl-md-4 pl-sm-2" v-else>
<button type="button" class="btn btn-primary font-weight-bold btn-sm" @click.prevent="followProfile()" data-toggle="tooltip" title="Follow">Follow</button> <button type="button" class="btn btn-primary font-weight-bold btn-sm" @click.prevent="followProfile()">Follow</button>
</span> </span>
</span> </span>
</div> </div>
@ -960,12 +960,10 @@
return o; return o;
}, },
followProfile($event) { followProfile() {
if($('body').hasClass('loggedIn') == false) { if($('body').hasClass('loggedIn') == false) {
return; return;
} }
$event.target.setAttribute('disabled','');
$event.target.blur();
axios.post('/i/follow', { axios.post('/i/follow', {
item: this.profileId item: this.profileId
}).then(res => { }).then(res => {
@ -979,7 +977,6 @@
this.profile.followers_count++; this.profile.followers_count++;
} }
this.relationship.following = !this.relationship.following; this.relationship.following = !this.relationship.following;
$event.target.removeAttribute('disabled');
}).catch(err => { }).catch(err => {
if(err.response.data.message) { if(err.response.data.message) {
swal('Error', err.response.data.message, 'error'); swal('Error', err.response.data.message, 'error');