Skip to content

Commit c691256

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

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/components/SidebarTabs/TransferOwnership.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@
6666
:placeholder="t('forms', 'Search for a user')"
6767
:user-select="true"
6868
label="displayName"
69-
@search="(query) => asyncSearch(query, true)">
69+
@search="
70+
(query) => asyncSearch(query, [SHARE_TYPES.SHARE_TYPE_USER])
71+
">
7072
<template #no-options>
7173
{{ noResultText }}
7274
</template>

src/mixins/UserSearchMixin.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ export default {
7676
* Search for suggestions
7777
*
7878
* @param {string} query The search query to search for
79+
* @param {number[]|undefined} shareType The type of recipient to search.
7980
*/
80-
async asyncSearch(query) {
81+
async asyncSearch(query, shareType) {
8182
// save query to check if valid
8283
this.query = query.trim()
8384
if (this.isValidQuery) {
8485
// already set loading to have proper ux feedback during debounce
8586
this.loading = true
86-
await this.debounceGetSuggestions(query)
87+
await this.debounceGetSuggestions(query, shareType)
8788
}
8889
},
8990

@@ -100,12 +101,13 @@ export default {
100101
* Get suggestions
101102
*
102103
* @param {string} query the search query
104+
* @param {number[]|undefined} shareType The type of recipient to search.
103105
*/
104-
async getSuggestions(query) {
106+
async getSuggestions(query, shareType) {
105107
this.loading = true
106108

107109
// Search for all used share-types, except public link.
108-
const shareType = this.SHARE_TYPES_USED.filter(
110+
shareType ??= this.SHARE_TYPES_USED.filter(
109111
(type) => type !== this.SHARE_TYPES.SHARE_TYPE_LINK,
110112
)
111113

0 commit comments

Comments
 (0)