Skip to content

Commit ad20b93

Browse files
pajladaWissididom
andauthored
fix(updates): handle nightly downgrade message (#6842)
Co-authored-by: Wissididom <30803034+Wissididom@users.noreply.github.com>
1 parent de9496a commit ad20b93

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unversioned
44

5+
- Bugfix: Improve nightly downgrade message. (#6842)
6+
57
## 2.5.5-beta.1
68

79
- Minor: Added a countdown timer to the input box to show when you can chat again during slow mode or after a timeout. This feature is disabled by default, and can be enabled with the "Show countdown on slow mode or when timed out" setting. (#6782, #6791)

src/singletons/Updates.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,15 @@ QString Updates::buildUpdateAvailableText() const
459459
if (version.isNightly())
460460
{
461461
// Since Nightly builds can be installed in many different ways, we ask the user to download the update manually.
462+
if (this->isDowngrade())
463+
{
464+
return QString("The version online (%1) seems to be lower than the "
465+
"current (%2).\nEither a version was reverted or "
466+
"you are running a newer build.\n\nDo you want to "
467+
"head to Chatterino.com to download it?")
468+
.arg(this->getOnlineVersion(), this->getCurrentVersion());
469+
}
470+
462471
return QString("An update (%1) is available.\n\nDo you want to head to "
463472
"Chatterino.com to download the new update?")
464473
.arg(this->getOnlineVersion());

tests/src/Updates.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ TEST(Updates, MustBeDowngrade)
2929
<< "2.4.5-beta must be a downgrade of 2.4.5-beta.2";
3030
EXPECT_TRUE(Updates::isDowngradeOf("2.4.5-beta.2", "2.4.6-beta.1"))
3131
<< "2.4.5-beta.2 must be a downgrade of 2.4.6-beta.1";
32+
EXPECT_TRUE(Updates::isDowngradeOf("2.5.4", "2.5.5-beta.1"))
33+
<< "2.5.4 must be a downgrade of 2.5.5-beta.1";
3234
}
3335

3436
TEST(Updates, MustNotBeDowngrade)

0 commit comments

Comments
 (0)