From cffbeb04e786d3ebe00f534bd7886aefe97941b6 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Sun, 27 Apr 2025 14:26:09 +0300 Subject: [PATCH] Fix to do not show empty parentheses if no Author's role. --- lib/decentralised_book_index_web/live/book_live/show.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/decentralised_book_index_web/live/book_live/show.ex b/lib/decentralised_book_index_web/live/book_live/show.ex index 959de2b..70e2518 100644 --- a/lib/decentralised_book_index_web/live/book_live/show.ex +++ b/lib/decentralised_book_index_web/live/book_live/show.ex @@ -121,7 +121,7 @@ defmodule DecentralisedBookIndexWeb.BookLive.Show do authors_string = author_roles |> Enum.map(fn author_role -> - if author_role.role == "" do + if author_role.role in ["", nil] do {"#{author_role.author.name}", author_role.author.id} else {"#{author_role.author.name} (#{author_role.role})", author_role.author.id}