Skip to content

Commit

Permalink
[fix] handle indicator when current sorting is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-cherukuri committed Jan 31, 2023
1 parent ad49fb6 commit b05824d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/filterrific/action_view_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def filterrific_sorting_link(filterrific, sort_key, opts = {})
current_sort_direction: if current_sorting
current_sorting.end_with?("_desc") ? "desc" : "asc"
end,
current_sort_direction_indicator: (current_sorting.end_with?("_desc") ? opts[:descending_indicator] : opts[:ascending_indicator])
current_sort_direction_indicator: if current_sorting
(current_sorting.end_with?("_desc") ? opts[:descending_indicator] : opts[:ascending_indicator])
end
)
new_sort_key = sort_key.to_s
if new_sort_key == opts[:current_sort_key]
Expand Down

0 comments on commit b05824d

Please sign in to comment.