Skip to content

Commit 101562c

Browse files
committed
fix(Settings): Only list users in transfer ownership
Signed-off-by: Louis Chmn <louis@chmn.me>
1 parent 086a97e commit 101562c

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/components/SidebarTabs/TransferOwnership.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
:loading="loading"
4545
:options="options"
4646
:placeholder="t('forms', 'Search for a user')"
47-
@search="asyncSearch">
47+
@search="
48+
(query) => asyncSearch(query, [SHARE_TYPES.SHARE_TYPE_USER])
49+
">
4850
<template #no-options>
4951
{{ noResultText }}
5052
</template>

src/mixins/UserSearchMixin.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ export default {
5858
* Search for suggestions
5959
*
6060
* @param {string} query The search query to search for
61+
* @param {number[]} shareType The type of recipient to search.
6162
*/
62-
async asyncSearch(query) {
63+
async asyncSearch(query, shareType = []) {
6364
// save query to check if valid
6465
this.query = query.trim()
6566
if (this.isValidQuery) {
6667
// already set loading to have proper ux feedback during debounce
6768
this.loading = true
68-
this.debounceGetSuggestions(query)
69+
this.debounceGetSuggestions(query, shareType)
6970
}
7071
},
7172

@@ -82,12 +83,13 @@ export default {
8283
* Get suggestions
8384
*
8485
* @param {string} query the search query
86+
* @param {number[]} shareType The type of recipient to search.
8587
*/
86-
async getSuggestions(query) {
88+
async getSuggestions(query, shareType = []) {
8789
this.loading = true
8890

8991
// Search for all used share-types, except public link.
90-
const shareType = this.SHARE_TYPES_USED.filter(
92+
shareType ??= this.SHARE_TYPES_USED.filter(
9193
(type) => type !== this.SHARE_TYPES.SHARE_TYPE_LINK,
9294
)
9395

0 commit comments

Comments
 (0)