Merge branch 'fix/follow-request-detection' into 'develop'

Utilize `user.requested` to display follow request status on user card

Closes #635

See merge request pleroma/pleroma-fe!942
This commit is contained in:
Shpuld Shpludson 2019-09-12 07:02:11 +00:00
commit 4a469d7fe3
3 changed files with 7 additions and 12 deletions

View file

@ -11,7 +11,6 @@ export default {
data () {
return {
followRequestInProgress: false,
followRequestSent: false,
hideUserStatsLocal: typeof this.$store.state.config.hideUserStats === 'undefined'
? this.$store.state.instance.hideUserStats
: this.$store.state.config.hideUserStats,
@ -112,9 +111,8 @@ export default {
followUser () {
const store = this.$store
this.followRequestInProgress = true
requestFollow(this.user, store).then(({ sent }) => {
requestFollow(this.user, store).then(() => {
this.followRequestInProgress = false
this.followRequestSent = sent
})
},
unfollowUser () {

View file

@ -135,13 +135,13 @@
<button
class="btn btn-default btn-block"
:disabled="followRequestInProgress"
:title="followRequestSent ? $t('user_card.follow_again') : ''"
:title="user.requested ? $t('user_card.follow_again') : ''"
@click="followUser"
>
<template v-if="followRequestInProgress">
{{ $t('user_card.follow_progress') }}
</template>
<template v-else-if="followRequestSent">
<template v-else-if="user.requested">
{{ $t('user_card.follow_sent') }}
</template>
<template v-else>