Add 'as loaded' sort ordering
This commit is contained in:
@ -27,11 +27,13 @@ const SearchResults = ({
|
||||
const encodedTerm = encodeURIComponent(term);
|
||||
let results = [...rawResults];
|
||||
|
||||
results = sortItems(
|
||||
results,
|
||||
(type === 'tracks' && sortField === 'followers' ? 'popularity' : sortField),
|
||||
sortReverse,
|
||||
);
|
||||
if (sortField) {
|
||||
results = sortItems(
|
||||
results,
|
||||
(type === 'tracks' && sortField === 'followers' ? 'popularity' : sortField),
|
||||
sortReverse,
|
||||
);
|
||||
}
|
||||
|
||||
const resultsCount = results.length;
|
||||
if (all && type !== 'tracks' && results.length > 5) {
|
||||
|
||||
@ -70,6 +70,7 @@ const Search = () => {
|
||||
}
|
||||
|
||||
const sortOptions = [
|
||||
{ value: null, label: i18n('fields.filters.as_loaded') },
|
||||
{ value: 'name', label: i18n('common.name') },
|
||||
{ value: 'uri', label: i18n('fields.filters.source') },
|
||||
{ value: 'followers', label: i18n('common.popularity') },
|
||||
|
||||
Reference in New Issue
Block a user