diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 503288e..6342b92 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -47,7 +47,11 @@ class StaticPagesController < ApplicationController @todays_languages = language_counts.map(&:first) @todays_editors = editor_counts.map(&:first) - @show_logged_time_sentence = @todays_languages.any? || @todays_editors.any? + @todays_duration = current_user.heartbeats.today.duration_seconds + + if @todays_duration > 1.minute + @show_logged_time_sentence = @todays_languages.any? || @todays_editors.any? + end cached_data = filterable_dashboard_data cached_data.entries.each do |key, value| diff --git a/app/views/static_pages/index.html.erb b/app/views/static_pages/index.html.erb index b064eee..309453b 100644 --- a/app/views/static_pages/index.html.erb +++ b/app/views/static_pages/index.html.erb @@ -69,7 +69,7 @@ <% if @show_logged_time_sentence %> You've logged - <%= short_time_detailed current_user.heartbeats.today.duration_seconds %> + <%= short_time_detailed @todays_duration %> <% if @todays_languages.any? || @todays_editors.any? %> across <% if @todays_languages.any? %>