From: Jay Freeman (saurik) Date: Wed, 29 Oct 2014 18:11:30 +0000 (-0700) Subject: Force a refresh if suspended for over ten minutes. X-Git-Tag: v1.1.14~17 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/95cd61f0148cda7af3739114e62b9a844dd082e8?ds=sidebyside Force a refresh if suspended for over ten minutes. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 21414b6c..823d9bd1 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 {