diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-03-01 21:04:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 21:04:05 +0100 |
commit | 34677082d8fb73fe5e9cdfd3c89f03a7c87da4fe (patch) | |
tree | 7463202de17e0cdef6a864e946562595f38a6b1b /settings/src | |
parent | 81601f8c325f0007b3f252b4845b56e1c72ab6b9 (diff) | |
parent | 6ad51a2990cf4a20e8c7384a0fa1126fa8b7796a (diff) | |
download | nextcloud-server-34677082d8fb73fe5e9cdfd3c89f03a7c87da4fe.tar.gz nextcloud-server-34677082d8fb73fe5e9cdfd3c89f03a7c87da4fe.zip |
Merge pull request #14405 from nextcloud/bugfix/14403/improve-multiselect-on-twofactor-settings
Improve multiselect handling on twofactor settings
Diffstat (limited to 'settings/src')
-rw-r--r-- | settings/src/components/AdminTwoFactor.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/settings/src/components/AdminTwoFactor.vue b/settings/src/components/AdminTwoFactor.vue index 0a20bf1b9e3..065ac9fbdda 100644 --- a/settings/src/components/AdminTwoFactor.vue +++ b/settings/src/components/AdminTwoFactor.vue @@ -94,7 +94,11 @@ mounted () { // Groups are loaded dynamically, but the assigned ones *should* // be valid groups, so let's add them as initial state - this.groups = _.sortedUniq(this.state.enforcedGroups.concat(this.state.excludedGroups)) + this.groups = _.sortedUniq(_.uniq(this.state.enforcedGroups.concat(this.state.excludedGroups))) + + // Populate the groups with a first set so the dropdown is not empty + // when opening the page the first time + this.searchGroup('') }, methods: { searchGroup: _.debounce(function (query) { @@ -102,7 +106,7 @@ Axios.get(OC.linkToOCS(`cloud/groups?offset=0&search=${encodeURIComponent(query)}&limit=20`, 2)) .then(res => res.data.ocs) .then(ocs => ocs.data.groups) - .then(groups => this.groups = _.sortedUniq(this.groups.concat(groups))) + .then(groups => this.groups = _.sortedUniq(_.uniq(this.groups.concat(groups)))) .catch(err => console.error('could not search groups', err)) .then(() => this.loadingGroups = false) }, 500), |