Skip to content

Commit

Permalink
remove unneeded map check
Browse files Browse the repository at this point in the history
  • Loading branch information
daveminer committed Nov 11, 2023
1 parent 68e6b46 commit edebe59
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/basket_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -721,16 +721,12 @@ defmodule BasketWeb.CoreComponents do
def diff_color(col, row) do
key = Map.get(col, :key)

if is_map(row) && key do
field = row[key]
field = row[key]

case elem(field, 1) do
"up" -> "bg-emerald-300 text-emerald-900"
"down" -> "bg-rose-300 text-rose-900"
_ -> ""
end
else
Logger.error("Should be a map: #{row}")
case elem(field, 1) do
"up" -> "bg-emerald-300 text-emerald-900"
"down" -> "bg-rose-300 text-rose-900"
_ -> ""
end
end
end

0 comments on commit edebe59

Please sign in to comment.