mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-17 11:04:22 +01:00
Fix errors on stat page for empty site
This commit is contained in:
parent
ea96900707
commit
c4b67ba30d
2 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ elixir:
|
||||||
p
|
p
|
||||||
' There are, on average,
|
' There are, on average,
|
||||||
span.stat>
|
span.stat>
|
||||||
= number_with_delimiter(trunc(img_bucket["non_deleted"]["avg_comments"]["value"]))
|
= number_with_delimiter(trunc(img_bucket["non_deleted"]["avg_comments"]["value"] || 0))
|
||||||
' comments on each image on the site.
|
' comments on each image on the site.
|
||||||
|
|
||||||
h3 Votes
|
h3 Votes
|
||||||
|
|
|
@ -8,7 +8,7 @@ defmodule PhilomenaWeb.StatView do
|
||||||
{
|
{
|
||||||
%{"doc_count" => min_docs},
|
%{"doc_count" => min_docs},
|
||||||
%{"doc_count" => max_docs}
|
%{"doc_count" => max_docs}
|
||||||
} = Enum.min_max_by(data, & &1["doc_count"], fn -> %{"doc_count" => 0} end)
|
} = Enum.min_max_by(data, & &1["doc_count"], fn -> {%{"doc_count" => 0}, %{"doc_count" => 0}} end)
|
||||||
|
|
||||||
graph_width = 950
|
graph_width = 950
|
||||||
graph_height = 475
|
graph_height = 475
|
||||||
|
|
Loading…
Reference in a new issue