Merge pull request #1447 from ychin/whats-new-show-prerelease

Allow showing pre-release in What's New page
This commit is contained in:
Yee Cheng Chin
2023-10-19 21:20:37 -07:00
committed by GitHub
2 changed files with 10 additions and 15 deletions
+9 -13
View File
@@ -504,8 +504,8 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
NSArray<NSString*> *currentVersionItems = [currentVersion componentsSeparatedByString:@"."];
// Compare two arrays lexographically. We just assume that version
// numbers are also X.Y.Z… with no "beta" etc texts.
bool currentVersionLarger = NO;
for (int i = 0; i < currentVersionItems.count && i < lastUsedVersionItems.count; i++) {
BOOL currentVersionLarger = NO;
for (int i = 0; i < currentVersionItems.count || i < lastUsedVersionItems.count; i++) {
if (i >= currentVersionItems.count) {
currentVersionLarger = NO;
break;
@@ -527,18 +527,14 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
if (currentVersionLarger) {
[ud setValue:currentVersion forKey:MMLastUsedBundleVersionKey];
// We have successfully updated to a new version. Show a "What's
// New" page to the user with latest release notes if the main
// release number has increased (we don't count the pre-release
// minor revision number for now).
if (lastUsedVersionItems[0].integerValue < currentVersionItems[0].integerValue) {
// We have successfully updated to a new version. Show a
// "What's New" page to the user with latest release notes
// unless they configured not to.
BOOL showWhatsNewSetting = [ud boolForKey:MMShowWhatsNewOnStartupKey];
BOOL showWhatsNewSetting = [ud boolForKey:MMShowWhatsNewOnStartupKey];
shouldShowWhatsNewPage = showWhatsNewSetting;
[MMWhatsNewController setRequestVersionRange:lastUsedVersion
to:currentVersion];
}
shouldShowWhatsNewPage = showWhatsNewSetting;
[MMWhatsNewController setRequestVersionRange:lastUsedVersion
to:currentVersion];
}
}
}
+1 -2
View File
@@ -83,8 +83,7 @@ static NSString *_latestVersion;
_latestVersion];
}
else {
// We just updated to a new version. Show a message to user and also
// requests specifically these new versions for the welcome message
// Just show the current version MacVim has
NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
whatsNewURLStr = [NSString stringWithFormat:@"%@?version=%@",