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({
|
.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation($id: ID!) {
|
mutation($id: ID!) {
|
||||||
follow(id: $id)
|
follow(id: $id, type: User)
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
variables: {
|
variables: {
|
||||||
id: this.followId
|
id: this.followId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(res => {
|
||||||
this.loading = false
|
if (res && res.data && res.data.follow) {
|
||||||
this.disabled = true
|
|
||||||
this.$emit('update')
|
this.$emit('update')
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.disabled = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
style="text-align: center"
|
style="text-align: center"
|
||||||
>
|
>
|
||||||
<ds-button
|
<ds-button
|
||||||
|
:loading="loading"
|
||||||
:disabled="disabled || loading || isShouted"
|
:disabled="disabled || loading || isShouted"
|
||||||
danger
|
danger
|
||||||
size="x-large"
|
size="x-large"
|
||||||
@ -53,13 +54,16 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res)
|
|
||||||
this.loading = false
|
|
||||||
this.disabled = true
|
|
||||||
if (res && res.data && res.data.shout) {
|
if (res && res.data && res.data.shout) {
|
||||||
this.shoutedCount++
|
this.shoutedCount = this.count + 1
|
||||||
}
|
}
|
||||||
this.$emit('update')
|
this.$emit('update')
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.disabled = true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user