Fix minor search issues
- Reset sorting for a new search - Descending sort is default for tags
This commit is contained in:
parent
ad1c728876
commit
aa4c994069
@ -61,12 +61,16 @@ export class SearchComponent implements OnInit {
|
|||||||
{name: 'Price', property: 'average_per_day_costs'}
|
{name: 'Price', property: 'average_per_day_costs'}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
this.sortBy = 'score';
|
||||||
|
this.sortDes = true;
|
||||||
|
|
||||||
if (this.results.length > 0) {
|
if (this.results.length > 0) {
|
||||||
this.results[0].scores.forEach(({type}) => {
|
const tags = await this.ss.getAvailableTags();
|
||||||
|
for (const {type} of this.results[0].scores) {
|
||||||
if (!this.sortOptions.find(i => i.property === type)) {
|
if (!this.sortOptions.find(i => i.property === type)) {
|
||||||
this.sortOptions.push({name: type, property: type, isScore: true});
|
this.sortOptions.push({name: type, property: type, isScore: true, descending: tags.includes(type)});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate duration
|
// Calculate duration
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user