only show hcard if user exists

This commit is contained in:
Inhji 2023-07-08 14:51:56 +02:00
parent b4d3d3ba00
commit 66f82d53d3
2 changed files with 3 additions and 6 deletions

View file

@ -115,12 +115,14 @@
</p>
</footer>
<%= if @profile do %>
<section class="hidden | hcard h-card">
<a href="/" rel="me" class="u-url"><%= @profile.name %></a>
<img class="u-photo" src={ChiyaWeb.Uploaders.UserImage.url({@profile.user_image, @profile}, :thumb)} />
<span class="p-nickname"><%= @profile.handle %></span>
<span class="p-note"><%= @profile.bio %></span>
</section>
<% end %>
<section class="flex h-1 w-full flex-row">
<div class="bg-theme-primary w-full"></div>

View file

@ -6,12 +6,7 @@ defmodule ChiyaWeb.GlobalAssigns do
def fetch_profile(conn, _opts) do
user = Chiya.Accounts.get_user(1)
if user do
assign(conn, :profile, user)
else
conn
end
assign(conn, :profile, user)
end
def fetch_settings(conn, _opts) do