Hide loader when there is no group

This commit is contained in:
Bubka
2020-11-29 18:57:17 +01:00
parent b7c49738a5
commit 913e492802

View File

@@ -29,7 +29,7 @@
{{ $t('groups.deleting_group_does_not_delete_accounts')}} {{ $t('groups.deleting_group_does_not_delete_accounts')}}
</div> </div>
</div> </div>
<div v-else class="has-text-centered"> <div v-if="isFetching && groups.length === 0" class="has-text-centered">
<span class="is-size-4"> <span class="is-size-4">
<font-awesome-icon :icon="['fas', 'spinner']" spin /> <font-awesome-icon :icon="['fas', 'spinner']" spin />
</span> </span>
@@ -52,6 +52,7 @@
return { return {
groups : [], groups : [],
TheAllGroup : null, TheAllGroup : null,
isFetching: false,
} }
}, },
@@ -73,6 +74,8 @@
async fetchGroups() { async fetchGroups() {
this.isFetching = true
await this.axios.get('api/groups').then(response => { await this.axios.get('api/groups').then(response => {
const groups = [] const groups = []
@@ -89,6 +92,8 @@
this.groups = groups this.groups = groups
}) })
this.isFetching = false
}, },
deleteGroup(id) { deleteGroup(id) {