always assign advert, even if nil

This commit is contained in:
byte[] 2020-08-13 17:55:36 -04:00
parent d1c893248d
commit 4bfb7d8dd3

View file

@ -22,7 +22,7 @@ defmodule PhilomenaWeb.AdvertPlug do
do: Conn.assign(conn, :advert, record_impression(Adverts.random_live_for(image)))
defp maybe_assign_ad(conn, _image, _false),
do: conn
do: Conn.assign(conn, :advert, nil)
defp show_ads?(%{hide_advertisements: hide}),
do: !hide