From 529cd8dc6ce0223e99f823450feb05278955bcc1 Mon Sep 17 00:00:00 2001 From: Kristijan Perusko Date: Fri, 12 Feb 2016 13:56:59 -0500 Subject: [PATCH] #120 Last activity duration is now updated when DS is finished --- DesignStudioExpress/ViewModels/RunningDesignStudio.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DesignStudioExpress/ViewModels/RunningDesignStudio.swift b/DesignStudioExpress/ViewModels/RunningDesignStudio.swift index 7d66a15..1de6f27 100644 --- a/DesignStudioExpress/ViewModels/RunningDesignStudio.swift +++ b/DesignStudioExpress/ViewModels/RunningDesignStudio.swift @@ -228,6 +228,8 @@ class RunningDesignStudio: NSObject { // show the challenge screen NSNotificationCenter.defaultCenter().postNotificationName(NotificationIdentifier.ShowNextChallengeScreen.rawValue, object: self, userInfo: nil) } else { + // update finished activity time before closing DS + self.updateCurrentActivity() self.finishDesignStudio() // we've reached the end, show the end screen NSNotificationCenter.defaultCenter().postNotificationName(NotificationIdentifier.ShowEndDesignStudioScreen.rawValue, object: self, userInfo: nil) @@ -331,7 +333,7 @@ class RunningDesignStudio: NSObject { self.startCurrentActivity() return result - } + } // update the duration of the activity to the actual duration of the activity // and status of the activity (finished)