Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

fix: default value if user's name isn't set (#1262)

Aaron Meese34ebd96c4c56
diff --git a/app/views/pages/dashboard.html.erb b/app/views/pages/dashboard.html.erb
index 68023607..64fecd9f 100644
--- a/app/views/pages/dashboard.html.erb
+++ b/app/views/pages/dashboard.html.erb
@@ -2,7 +2,9 @@
<header class="flex items-center justify-between">
<div>
<h1 class="sr-only"><%= t(".title") %></h1>
- <p class="text-xl font-medium text-gray-900 mb-1"><%= t(".greeting", name: Current.user.first_name ) %></p>
+ <p class="text-xl font-medium text-gray-900 mb-1">
+ <%= Current.user.first_name.present? ? t(".greeting", name: Current.user.first_name ) : t(".fallback_greeting") %>
+ </p>
<% unless @accounts.blank? %>
<p class="text-gray-500 text-sm"><%= t(".subtitle") %></p>
<% end %>
diff --git a/config/locales/views/pages/en.yml b/config/locales/views/pages/en.yml
index 493632ff..31152abb 100644
--- a/config/locales/views/pages/en.yml
+++ b/config/locales/views/pages/en.yml
@@ -8,6 +8,7 @@ en:
assets: Assets
debts: Debts
greeting: Welcome back, %{name}
+ fallback_greeting: Welcome back, friend
import: Import
income: Income
investing: Investing (coming soon...)