mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update SearchResults.vue
This commit is contained in:
parent
4acafb9870
commit
c539e8f607
1 changed files with 7 additions and 7 deletions
|
@ -57,9 +57,9 @@
|
||||||
{{profile.value}}
|
{{profile.value}}
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-0 text-center">
|
<p class="mb-0 text-center">
|
||||||
<button :class="[profile.entity.following ? 'btn btn-secondary btn-sm py-1 font-weight-bold' : 'btn btn-primary btn-sm py-1 font-weight-bold']" v-on:click="followProfile(profile.entity.id)">
|
<button v-if="profile.entity.follow_request" type="button" class="btn btn-secondary btn-sm py-1 font-weight-bold" disabled>Follow Requested</button>
|
||||||
{{profile.entity.following ? 'Unfollow' : 'Follow'}}
|
<button v-if="!profile.entity.follow_request && profile.entity.following" type="button" class="btn btn-secondary btn-sm py-1 font-weight-bold" @click.prevent="followProfile(profile)">Unfollow</button>
|
||||||
</button>
|
<button v-if="!profile.entity.follow_request && !profile.entity.following" type="button" class="btn btn-primary btn-sm py-1 font-weight-bold" @click.prevent="followProfile(profile)">Follow</button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -140,12 +140,12 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
followProfile(id) {
|
followProfile(profile) {
|
||||||
// todo: finish AP Accept handling to enable remote follows
|
this.loading = true;
|
||||||
axios.post('/i/follow', {
|
axios.post('/i/follow', {
|
||||||
item: id
|
item: profile.entity.id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
window.location.href = window.location.href;
|
this.fetchSearchResults();
|
||||||
}).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');
|
||||||
|
|
Loading…
Reference in a new issue