Merge branch 'charlesmchen/upgradeLaunchScreenAndPerf'

pull/1/head
Matthew Chen 7 years ago
commit ae9a5acf69

@ -199,13 +199,22 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
[[UIStoryboard storyboardWithName:@"Launch Screen" bundle:nil] instantiateInitialViewController];
BOOL shouldShowUpgradeLabel = NO;
NSString *previousVersion = AppVersion.instance.lastCompletedLaunchAppVersion;
NSString *lastAppVersion = AppVersion.instance.lastAppVersion;
NSString *lastCompletedLaunchAppVersion = AppVersion.instance.lastCompletedLaunchAppVersion;
BOOL mayNeedUpgrade = ([TSAccountManager isRegistered] &&
[VersionMigrations isVersion:lastAppVersion atLeast:@"2.0.0" andLessThan:@"2.13.0"]);
BOOL hasCompletedUpgrade = (lastCompletedLaunchAppVersion &&
[VersionMigrations isVersion:lastCompletedLaunchAppVersion atLeast:@"2.13.0"]);
// We added a number of database views in v2.13.0.
if ([TSAccountManager isRegistered] &&
[VersionMigrations isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.13.0"]) {
if (mayNeedUpgrade && !hasCompletedUpgrade) {
shouldShowUpgradeLabel = YES;
}
DDLogInfo(@"%@ shouldShowUpgradeLabel: %d", self.tag, shouldShowUpgradeLabel);
DDLogInfo(@"%@ shouldShowUpgradeLabel: %d, %d -> %d",
self.tag,
mayNeedUpgrade,
hasCompletedUpgrade,
shouldShowUpgradeLabel);
if (shouldShowUpgradeLabel) {
UIView *rootView = viewController.view;
UIImageView *iconView = nil;

@ -16,4 +16,6 @@
atLeast:(NSString *)openLowerBoundVersionString
andLessThan:(NSString *)closedUpperBoundVersionString;
+ (BOOL)isVersion:(NSString *)thisVersionString atLeast:(NSString *)thatVersionString;
@end

Loading…
Cancel
Save