Permalink
Browse files

Actually reset the usage time when saving it

  • Loading branch information...
TheRealKerni committed Mar 20, 2013
1 parent 38149b7 commit 5a50d8f24b3c9260c1802ac2c444a2745d548107
Showing with 2 additions and 0 deletions.
  1. +2 −0 Classes/BetaDistribution/BITSystemProfile.m
@@ -147,6 +147,8 @@ - (void)stopUsage {
double timeDifference = [[NSDate date] timeIntervalSinceReferenceDate] - [self.usageStartTimestamp timeIntervalSinceReferenceDate];
double previousTimeDifference = [(NSNumber *)[[NSUserDefaults standardUserDefaults] valueForKey:kBITUpdateUsageTimeOfCurrentVersion] doubleValue];
+ self.usageStartTimestamp = nil;
+
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:previousTimeDifference + timeDifference] forKey:kBITUpdateUsageTimeOfCurrentVersion];
[[NSUserDefaults standardUserDefaults] synchronize];
}

0 comments on commit 5a50d8f

Please sign in to comment.