From 341737fc160a77a282713e76cc6f522e36f122b5 Mon Sep 17 00:00:00 2001 From: David Gay Date: Fri, 4 Jun 2021 10:46:47 -0400 Subject: Don't start progress bar halfway done due to rested time --- app/models/character.rb | 2 +- app/views/application/_timer.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/character.rb b/app/models/character.rb index 8a72ccd..b4e597b 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -210,7 +210,7 @@ class Character < ApplicationRecord end def percentage_of_activity_completed - (1 - (activity_time_remaining / activity_duration)) * 100 + (1 - (activity_time_remaining / (activity_duration - rested_duration_to_spend_on_activity))) * 100 end def rested_duration_to_spend_on_activity diff --git a/app/views/application/_timer.html.erb b/app/views/application/_timer.html.erb index 06c4dd7..ca12a77 100644 --- a/app/views/application/_timer.html.erb +++ b/app/views/application/_timer.html.erb @@ -2,7 +2,7 @@

<%= current_char.activity.name %>

-- cgit v1.2.3