diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue index c9a326d26f3bd..a4ab6e154805a 100644 --- a/apps/settings/src/components/UserList.vue +++ b/apps/settings/src/components/UserList.vue @@ -459,8 +459,13 @@ export default { group: this.selectedGroup !== 'disabled' ? this.selectedGroup : '', search: this.searchQuery, }) - .then((response) => { - response ? $state.loaded() : $state.complete() + .then((usersCount) => { + if (usersCount > 0) { + $state.loaded() + } + if (usersCount < this.usersLimit) { + $state.complete() + } }) }, diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js index 475486d6c402c..ec2cf49743d01 100644 --- a/apps/settings/src/store/users.js +++ b/apps/settings/src/store/users.js @@ -224,11 +224,12 @@ const actions = { cancelToken: searchRequestCancelSource.token, }) .then((response) => { - if (Object.keys(response.data.ocs.data.users).length > 0) { + const usersCount = Object.keys(response.data.ocs.data.users).length + if (usersCount > 0) { context.commit('appendUsers', response.data.ocs.data.users) - return Object.keys(response.data.ocs.data.users).length >= limit + return usersCount } - return false + return 0 }) .catch((error) => { if (!axios.isCancel(error)) { @@ -241,11 +242,12 @@ const actions = { cancelToken: searchRequestCancelSource.token, }) .then((response) => { - if (Object.keys(response.data.ocs.data.users).length > 0) { + const usersCount = Object.keys(response.data.ocs.data.users).length + if (usersCount > 0) { context.commit('appendUsers', response.data.ocs.data.users) - return Object.keys(response.data.ocs.data.users).length >= limit + return usersCount } - return false + return 0 }) .catch((error) => { if (!axios.isCancel(error)) {