transform animation to computed method

This commit is contained in:
mahula 2023-04-07 16:53:45 +02:00
parent ab8bec8a4e
commit adcff96e29

View File

@ -44,24 +44,24 @@ export default {
oldPublicKey: '',
communities: [],
icon: '',
animation: '',
}
},
computed: {
animation() {
return this.$apollo.queries.GetCommunities.loading ? 'spin' : ''
},
},
apollo: {
GetCommunities: {
fetchPolicy: 'network-only',
query() {
this.animation = 'spin'
return getCommunities
},
update({ getCommunities }) {
this.communities = getCommunities
this.animation = ''
},
error({ message }) {
this.toastError(message)
this.animation = ''
},
},
},