defmodule WishWeb.Plug.GetLayoutFromCookie do
  import Plug.Conn

  def init(_) do
    %{}
  end

  def call(conn, _opts) do
    conn = fetch_cookies(conn)

    case conn.cookies["user_display"] do
      nil -> conn
      other -> conn |> put_session(:user_display, other)
    end
  end
end
