mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 14:17:59 +01:00
remove superfluous jason encode
This commit is contained in:
parent
e1be291698
commit
0dab6a76e5
1 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
use PhilomenaWeb, :view
|
||||
|
||||
alias PhilomenaWeb.ImageView
|
||||
alias Plug.Conn
|
||||
|
||||
def layout_class(conn) do
|
||||
conn.assigns[:layout_class] || "layout--narrow"
|
||||
|
@ -28,11 +29,12 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
defp ignored_tag_list(tags), do: Enum.map(tags, & &1.id)
|
||||
|
||||
def clientside_data(conn) do
|
||||
conn = Conn.fetch_cookies(conn)
|
||||
|
||||
extra = Map.get(conn.assigns, :clientside_data, [])
|
||||
interactions = Map.get(conn.assigns, :interactions, [])
|
||||
user = conn.assigns.current_user
|
||||
filter = conn.assigns.current_filter
|
||||
conn = Plug.Conn.fetch_cookies(conn)
|
||||
|
||||
data = [
|
||||
filter_id: filter.id,
|
||||
|
@ -51,7 +53,7 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
fancy_tag_upload: if(user, do: user.fancy_tag_field_on_upload, else: true),
|
||||
interactions: Jason.encode!(interactions),
|
||||
ignored_tag_list: Jason.encode!(ignored_tag_list(conn.assigns[:tags])),
|
||||
hide_staff_tools: Jason.encode!(conn.cookies["hide_staff_tools"])
|
||||
hide_staff_tools: conn.cookies["hide_staff_tools"]
|
||||
]
|
||||
|
||||
data = Keyword.merge(data, extra)
|
||||
|
|
Loading…
Reference in a new issue