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: '', oldPublicKey: '',
communities: [], communities: [],
icon: '', icon: '',
animation: '',
} }
}, },
computed: {
animation() {
return this.$apollo.queries.GetCommunities.loading ? 'spin' : ''
},
},
apollo: { apollo: {
GetCommunities: { GetCommunities: {
fetchPolicy: 'network-only', fetchPolicy: 'network-only',
query() { query() {
this.animation = 'spin'
return getCommunities return getCommunities
}, },
update({ getCommunities }) { update({ getCommunities }) {
this.communities = getCommunities this.communities = getCommunities
this.animation = ''
}, },
error({ message }) { error({ message }) {
this.toastError(message) this.toastError(message)
this.animation = ''
}, },
}, },
}, },