From ea5169073569e6eda10cf0b7c2b196d10598a99e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 12 Aug 2019 18:31:59 +0200 Subject: [PATCH] style(dbtable): show only one sorting direction Fixes #369 --- src/Handler/Utils/Table/Pagination.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs index e97ab4ab3..e4560d8eb 100644 --- a/src/Handler/Utils/Table/Pagination.hs +++ b/src/Handler/Utils/Table/Pagination.hs @@ -1039,7 +1039,7 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db let directions = [dir | SortingSetting k dir <- psSorting, Just k == sortableKey ] isSortable = isJust sortableKey - isSorted = (`elem` directions) + isSorted dir = fromMaybe False $ (==) <$> (SortingSetting <$> sortableKey <*> pure dir) <*> listToMaybe psSorting attrs = sortableContent ^. cellAttrs piSorting' = [ sSet | sSet <- fromMaybe [] piSorting, Just (sortKey sSet) /= sortableKey ] case dbsTemplate of