Skip to content

Commit

Permalink
fixing sorting of created field to decending by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Clifford committed Feb 22, 2021
1 parent c274774 commit fa38fa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/ui/src/components/Problems/sortedItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ const useSortableProblemsData = (initialItems) => {
}

const requestSort = (key) => {
let direction = 'ascending';
let direction = key !== 'created' ? 'ascending' : 'descending';

if (sortConfig && sortConfig.key === key && sortConfig.direction === 'ascending') {
direction = 'descending';
if (sortConfig && sortConfig.key === key && sortConfig.direction === direction) {
direction = direction === 'ascending' ? 'descending' : 'ascending';
}

setCurrentItems(sortedItems);
Expand Down

0 comments on commit fa38fa1

Please sign in to comment.