Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions frontend/src/components/store/Store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ const BrowseTab: FC<{ setPluginCount: Dispatch<SetStateAction<number | null>> }>

const dropdownSortOptions = useMemo(
(): DropdownOption[] => [
// ascending and descending order are the wrong way around for the alphabetical sort
// this is because it was initially done incorrectly for i18n and 'fixing' it would
// make all the translations incorrect
{ data: [SortOptions.name, SortDirections.ascending], label: t('Store.store_tabs.alph_desc') },
{ data: [SortOptions.name, SortDirections.descending], label: t('Store.store_tabs.alph_asce') },
{ data: [SortOptions.date, SortDirections.ascending], label: t('Store.store_tabs.date_asce') },
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ export async function getPluginList(

let query: URLSearchParams | string = new URLSearchParams();
sort_by && query.set('sort_by', sort_by);
sort_direction && query.set('sort_direction', sort_direction);
if (sort_direction) {
// Backend currently interprets asc/desc the opposite way around, so invert the value
// to keep the UI-provided sort direction correct. Remove once backend is fixed (issue #862).
const backendSortDirection =
sort_direction === SortDirections.ascending ? SortDirections.descending : SortDirections.ascending;
query.set('sort_direction', backendSortDirection);
}
query = '?' + String(query);

let storeURL;
Expand Down