Skip to content

Commit 3593018

Browse files
artongeChartman123
authored andcommitted
fix(Settings): Only list users in transfer ownership
Signed-off-by: Louis Chmn <louis@chmn.me>
1 parent c823c12 commit 3593018

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
@@ -59,14 +59,15 @@ export default {
5959
* Search for suggestions
6060
*
6161
* @param {string} query The search query to search for
62+
* @param {number[]|undefined} shareType The type of recipient to search.
6263
*/
63-
async asyncSearch(query) {
64+
async asyncSearch(query, shareType) {
6465
// save query to check if valid
6566
this.query = query.trim()
6667
if (this.isValidQuery) {
6768
// already set loading to have proper ux feedback during debounce
6869
this.loading = true
69-
this.debounceGetSuggestions(query)
70+
this.debounceGetSuggestions(query, shareType)
7071
}
7172
},
7273

@@ -83,12 +84,13 @@ export default {
8384
* Get suggestions
8485
*
8586
* @param {string} query the search query
87+
* @param {number[]|undefined} shareType The type of recipient to search.
8688
*/
87-
async getSuggestions(query) {
89+
async getSuggestions(query, shareType) {
8890
this.loading = true
8991

9092
// Search for all used share-types, except public link.
91-
const shareType = this.SHARE_TYPES_USED.filter(
93+
shareType ??= this.SHARE_TYPES_USED.filter(
9294
(type) => type !== this.SHARE_TYPES.SHARE_TYPE_LINK,
9395
)
9496

0 commit comments

Comments
 (0)