Skip to content

Commit ae9a5ac

Browse files
committed
Merge branch 'charlesmchen/upgradeLaunchScreenAndPerf'
2 parents 949a38c + 0738568 commit ae9a5ac

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Signal/src/AppDelegate.m

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,22 @@ - (UIViewController *)loadingRootViewController
199199
[[UIStoryboard storyboardWithName:@"Launch Screen" bundle:nil] instantiateInitialViewController];
200200

201201
BOOL shouldShowUpgradeLabel = NO;
202-
NSString *previousVersion = AppVersion.instance.lastCompletedLaunchAppVersion;
202+
NSString *lastAppVersion = AppVersion.instance.lastAppVersion;
203+
NSString *lastCompletedLaunchAppVersion = AppVersion.instance.lastCompletedLaunchAppVersion;
204+
BOOL mayNeedUpgrade = ([TSAccountManager isRegistered] &&
205+
[VersionMigrations isVersion:lastAppVersion atLeast:@"2.0.0" andLessThan:@"2.13.0"]);
206+
BOOL hasCompletedUpgrade = (lastCompletedLaunchAppVersion &&
207+
[VersionMigrations isVersion:lastCompletedLaunchAppVersion atLeast:@"2.13.0"]);
208+
203209
// We added a number of database views in v2.13.0.
204-
if ([TSAccountManager isRegistered] &&
205-
[VersionMigrations isVersion:previousVersion atLeast:@"2.0.0" andLessThan:@"2.13.0"]) {
210+
if (mayNeedUpgrade && !hasCompletedUpgrade) {
206211
shouldShowUpgradeLabel = YES;
207212
}
208-
DDLogInfo(@"%@ shouldShowUpgradeLabel: %d", self.tag, shouldShowUpgradeLabel);
213+
DDLogInfo(@"%@ shouldShowUpgradeLabel: %d, %d -> %d",
214+
self.tag,
215+
mayNeedUpgrade,
216+
hasCompletedUpgrade,
217+
shouldShowUpgradeLabel);
209218
if (shouldShowUpgradeLabel) {
210219
UIView *rootView = viewController.view;
211220
UIImageView *iconView = nil;

Signal/src/environment/VersionMigrations.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
atLeast:(NSString *)openLowerBoundVersionString
1717
andLessThan:(NSString *)closedUpperBoundVersionString;
1818

19+
+ (BOOL)isVersion:(NSString *)thisVersionString atLeast:(NSString *)thatVersionString;
20+
1921
@end

0 commit comments

Comments
 (0)