mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-23 06:25:14 +00:00
Improve performance
This commit is contained in:
parent
8bc5febe66
commit
10f466c895
3 changed files with 13 additions and 4 deletions
|
@ -187,7 +187,8 @@ export default Vue.extend({
|
||||||
} else {
|
} else {
|
||||||
this.$root.api('users/search', {
|
this.$root.api('users/search', {
|
||||||
query: this.q,
|
query: this.q,
|
||||||
limit: 10
|
limit: 10,
|
||||||
|
detail: false
|
||||||
}).then(users => {
|
}).then(users => {
|
||||||
this.users = users;
|
this.users = users;
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
|
|
|
@ -116,7 +116,8 @@ export default Vue.extend({
|
||||||
this.$root.api('users/search', {
|
this.$root.api('users/search', {
|
||||||
query: this.q,
|
query: this.q,
|
||||||
localOnly: true,
|
localOnly: true,
|
||||||
limit: 10
|
limit: 10,
|
||||||
|
detail: false
|
||||||
}).then(users => {
|
}).then(users => {
|
||||||
this.result = users.filter(user => user.id != this.$store.state.i.id);
|
this.result = users.filter(user => user.id != this.$store.state.i.id);
|
||||||
});
|
});
|
||||||
|
|
|
@ -41,6 +41,14 @@ export const meta = {
|
||||||
'ja-JP': 'ローカルユーザーのみ検索対象にするか否か'
|
'ja-JP': 'ローカルユーザーのみ検索対象にするか否か'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
detail: {
|
||||||
|
validator: $.bool.optional,
|
||||||
|
default: true,
|
||||||
|
desc: {
|
||||||
|
'ja-JP': '詳細なユーザー情報を含めるか否か'
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,6 +80,5 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serialize
|
res(await Promise.all(users.map(user => pack(user, me, { detail: ps.detail }))));
|
||||||
res(await Promise.all(users.map(user => pack(user, me, { detail: true }))));
|
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue