Fix sort in search
This commit is contained in:
parent
60f9100cd2
commit
8c528b5e33
|
@ -188,10 +188,7 @@
|
||||||
this.countUpdater?.stop();
|
this.countUpdater?.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.results = (_.filter(
|
this.resort();
|
||||||
this.results,
|
|
||||||
(x) => this.isSpeciesMatch(x)
|
|
||||||
) as SearchResult[]).sort(sort);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -231,6 +228,8 @@
|
||||||
// this is done LAST to force Vue to wait with rendering
|
// this is done LAST to force Vue to wait with rendering
|
||||||
this.hasReceivedResults = true;
|
this.hasReceivedResults = true;
|
||||||
this.results = results;
|
this.results = results;
|
||||||
|
|
||||||
|
this.resort(results);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.scoreWatcher) {
|
if (this.scoreWatcher) {
|
||||||
|
@ -288,6 +287,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private resort(results = this.results) {
|
||||||
|
this.results = (_.filter(
|
||||||
|
results,
|
||||||
|
(x) => this.isSpeciesMatch(x)
|
||||||
|
) as SearchResult[]).sort(sort);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
isSpeciesMatch(result: SearchResult): boolean {
|
isSpeciesMatch(result: SearchResult): boolean {
|
||||||
if (this.data.species.length === 0) {
|
if (this.data.species.length === 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue