File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff line change 1616 atLeast : (NSString *)openLowerBoundVersionString
1717 andLessThan : (NSString *)closedUpperBoundVersionString ;
1818
19+ + (BOOL )isVersion : (NSString *)thisVersionString atLeast : (NSString *)thatVersionString ;
20+
1921@end
You can’t perform that action at this time.
0 commit comments