[ui] add default search limit at 50

feat/vaults
Tomáš Mládek 2022-01-30 16:29:04 +01:00
parent 34847f3321
commit 859838f124
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
1 changed files with 4 additions and 1 deletions

View File

@ -11,12 +11,15 @@ export function baseSearchOnce(query: string) {
}
export async function getObjects(
entries: UpEntry[]
entries: UpEntry[],
limit = 50
): Promise<[string, string][]> {
const labelled = entries
.slice(0, limit)
.filter((e) => e.attribute == "LBL")
.map((e) => [e.entity, String(e.value.c)] as [string, string]);
const aliased = entries
.slice(0, limit)
.filter((e) => e.attribute === "ALIAS")
.map(async (aliasEntry) => {
const entry = await fetchEntry(aliasEntry.entity);