<ul>
  <% if session[:current_user].present? %>

    <li class="dropdown-item">
      <div class="profile-image" style="background-image: url(<%= session[:current_user][:photo] %>);">
        <%= session[:current_user][:name][0..1] unless session[:current_user][:photo] || session[:current_user][:name].blank? %>
      </div>
      <ul>
        <li>
          <a href="#" class="triggerMySubscriptions">My Subscriptions</a>
        </li>
        <li>
          <a href="<%= logout_path %>">Logout</a>
        </li>
      </ul>
    </li>

  <% else %>

      <li>
        <a href=<%= login_path %>>Login</a>
      </li>

  <% end %>
</ul>

<ul>
  <% if session[:current_user].present? %>

    <li class="dropdown-item">
      <div class="profile-image" style="background-image: url(<%= session[:current_user][:photo] %>);">
        <%= session[:current_user][:email][0..1] unless session[:current_user][:photo] %>
      </div>
      <ul>
        <li>
          <a href="#" class="triggerMySubscriptions">My Subscriptions</a>
        </li>
        <li>
          <a href="<%= logout_path %>">Logout</a>
        </li>
      </ul>
    </li>

  <% else %>

      <li>
        <a href=<%= login_path %>>Login</a>
      </li>

  <% end %>
</ul>

Improve the icon of the user profile
Improve the icon of the user profile

When the user doesn't have any photo, the two first letters of their email address is displayed. We previously displayed the first letters of their name but it might also be missing.
