summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-10-29 11:11:30 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-10-29 11:11:30 -0700
commit95cd61f0148cda7af3739114e62b9a844dd082e8 (patch)
tree79ee33beb3f335cbc27c9dae4fed06cf6eed5df7 /MobileCydia.mm
parentd4011d57513b011ac254e7205fb7817f57866b48 (diff)
Force a refresh if suspended for over ten minutes.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 21414b6..823d9bd 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -9725,6 +9725,19 @@ _end
}
- (void) applicationWillEnterForeground:(UIApplication *)application {
+ NSDate *closed = [Metadata_ objectForKey:@"LastClosed"];
+ if (closed == nil)
+ return;
+
+ NSTimeInterval interval([closed timeIntervalSinceNow]);
+ // XXX: Is 10 minutes the optimal time here?
+ if (interval > -(10*60))
+ return;
+
+ if (!IsReachable("cydia.saurik.com"))
+ return;
+
+ [tabbar_ beginUpdate];
}
- (void) setConfigurationData:(NSString *)data {