mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fixed shout and follow behavior
This commit is contained in:
parent
dc13467294
commit
30e7c57764
@ -34,17 +34,23 @@ export default {
|
||||
.mutate({
|
||||
mutation: gql`
|
||||
mutation($id: ID!) {
|
||||
follow(id: $id)
|
||||
follow(id: $id, type: User)
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
id: this.followId
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
.then(res => {
|
||||
if (res && res.data && res.data.follow) {
|
||||
this.$emit('update')
|
||||
this.$nextTick(() => {
|
||||
this.disabled = true
|
||||
})
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false
|
||||
this.disabled = true
|
||||
this.$emit('update')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
style="text-align: center"
|
||||
>
|
||||
<ds-button
|
||||
:loading="loading"
|
||||
:disabled="disabled || loading || isShouted"
|
||||
danger
|
||||
size="x-large"
|
||||
@ -53,13 +54,16 @@ export default {
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
this.loading = false
|
||||
this.disabled = true
|
||||
if (res && res.data && res.data.shout) {
|
||||
this.shoutedCount++
|
||||
this.shoutedCount = this.count + 1
|
||||
}
|
||||
this.$emit('update')
|
||||
this.$nextTick(() => {
|
||||
this.disabled = true
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user