Method: Marty::AuthApp#menu

Defined in:
app/components/marty/auth_app.rb

Set the Logout button if current_user is set



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/components/marty/auth_app.rb', line 11

def menu
  [].tap do |menu|
    user = Mcfly.whodunnit
    if !user.nil?
      menu << "->" << {
        text: user.name,
        tooltip: 'Current user',
        menu: user_menu,
        name: "sign_out",
      }
    else
      menu << "->" << :sign_in
    end
  end
end