only show public and active identities on home page

This commit is contained in:
Inhji 2023-04-07 10:32:16 +02:00
parent e03737853c
commit bcae8b0d92
2 changed files with 5 additions and 2 deletions

View file

@ -8,7 +8,7 @@
<div class="w-full mt-6 sm:w-auto">
<div class="flex gap-4 text-sm leading-6 text-theme-base">
<%= for identity <- @identities do %>
<%= for identity <- @public_identities do %>
<div>
<a
rel={identity.rel}

View file

@ -8,7 +8,10 @@ defmodule ChiyaWeb.GlobalAssigns do
def fetch_identities(conn, _opts) do
identities = Chiya.Identities.list_identities()
assign(conn, :identities, identities)
conn
|> assign(:identities, identities)
|> assign(:public_identities, Enum.filter(identities, fn i -> i.public && i.active end))
end
def fetch_public_channels(conn, _opts) do