perf: only resort once initial query has finished
parent
b0ef7f86cb
commit
0d5e201ff2
|
@ -88,9 +88,10 @@
|
|||
|
||||
// Sorting
|
||||
let sortedAttributes = entries;
|
||||
let resort = false;
|
||||
|
||||
let sortKeys: { [key: string]: string[] } = {};
|
||||
function addSortKeys(key: string, vals: string[], resort = true) {
|
||||
function addSortKeys(key: string, vals: string[]) {
|
||||
if (!sortKeys[key]) {
|
||||
sortKeys[key] = [];
|
||||
}
|
||||
|
@ -116,19 +117,18 @@
|
|||
entries.forEach((entry) => {
|
||||
addSortKeys(
|
||||
entry.entity,
|
||||
$labelListing.getObject(entry.entity).identify(),
|
||||
false
|
||||
$labelListing.getObject(entry.entity).identify()
|
||||
);
|
||||
|
||||
if (entry.value.t === "Address") {
|
||||
addSortKeys(
|
||||
entry.value.c,
|
||||
$labelListing.getObject(String(entry.value.c)).identify(),
|
||||
false
|
||||
$labelListing.getObject(String(entry.value.c)).identify()
|
||||
);
|
||||
}
|
||||
});
|
||||
sortAttributes();
|
||||
resort = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,8 +137,7 @@
|
|||
if (entry.value.t === "Address") {
|
||||
addSortKeys(
|
||||
entry.value.c,
|
||||
entry.listing.getObject(String(entry.value.c)).identify(),
|
||||
false
|
||||
entry.listing.getObject(String(entry.value.c)).identify()
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,9 +20,10 @@
|
|||
|
||||
// Sorting
|
||||
let sortedEntities = deduplicatedEntities || [];
|
||||
let resort = false;
|
||||
|
||||
let sortKeys: { [key: string]: string[] } = {};
|
||||
function addSortKeys(key: string, vals: string[], resort = true) {
|
||||
function addSortKeys(key: string, vals: string[]) {
|
||||
if (!sortKeys[key]) {
|
||||
sortKeys[key] = [];
|
||||
}
|
||||
|
@ -80,6 +81,7 @@
|
|||
addSortKeys(address, $labelListing.getObject(address).identify());
|
||||
});
|
||||
sortAttributes();
|
||||
resort = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue