]> git.saurik.com Git - cydia.git/commitdiff
Force a refresh if suspended for over ten minutes.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Oct 2014 18:11:30 +0000 (11:11 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Oct 2014 18:11:30 +0000 (11:11 -0700)
MobileCydia.mm

index 21414b6c2800672efdd8cea644278b04f32c90e8..823d9bd11ac7787440d12cd3defe63f6ecb5f784 100644 (file)
@@ -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 {