Fix defaultSortDesc blocking toggle action (#1341)

* Fix defaultSortDesc blocking toggle action

* Revert "Fix defaultSortDesc blocking toggle action"

This reverts commit 15e05cefd820e3f63e80a8e9d31b9431f295b55a.

* Fix defaultSortDesc blocking toggle action
This commit is contained in:
Dmitrii Gaidarji 2019-05-31 22:17:58 +09:00 committed by Tanner Linsley
parent 2f5ebe460f
commit 5b0e68aead

View File

@ -82,7 +82,8 @@ export const useSortBy = props => {
if (!multi) {
if (sortBy.length <= 1 && existingSortBy) {
if (existingSortBy.desc) {
if ((existingSortBy.desc && !resolvedDefaultSortDesc) ||
(!existingSortBy.desc && resolvedDefaultSortDesc)) {
action = 'remove'
} else {
action = 'toggle'