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