Skip to content

Commit

Permalink
Fix issue with names that have extra spaces crashing intiials (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
mveytsman committed May 5, 2024
1 parent de8c0e6 commit 9f73300
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bike_brigade_web/live/campaign_signup_live/show.ex
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ defmodule BikeBrigadeWeb.CampaignSignupLive.Show do
task.assigned_rider.id == current_rider_id && !campaign_in_past(campaign)
end

defp initials(name) do
def initials(name) do
name
|> String.split(~r/[\s+|-]/)
|> String.split(~r/[\s+|-]/, trim: true)
|> Enum.map(&String.first/1)
|> Enum.map(&String.upcase/1)
|> Enum.join()
Expand Down

0 comments on commit 9f73300

Please sign in to comment.