Skip to content

Commit

Permalink
fix: don't try v4 yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Mar 30, 2024
1 parent d1debd6 commit eb17c71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/singletons/Updates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,12 @@ void Updates::checkForUpdates()
}
};

// We're trying v2, v3, and v4 to get updates.
// We're trying v2, v3, ~~and v4~~ to get updates.
// The first successful one will be used
// TODO: remove this once v3 has the endpoint
auto apiVersion = std::make_shared<uint8_t>(2);
constexpr auto maxApiVersion =
3; // don't try v4 yet (we don't know the API scheme yet)
auto fmtUrl = [apiVersion] {
return u"https://7tv.io/v%1/chatterino/version/"_s CHATTERINO_OS
"/%2".arg(QString::number(*apiVersion), currentBranch());
Expand Down Expand Up @@ -387,7 +390,7 @@ void Updates::checkForUpdates()
};

*onError = [apiVersion, fmtUrl, makeRequest](const auto &) mutable {
if (*apiVersion >= 4)
if (*apiVersion >= maxApiVersion)
{
return; // nothing returned a response, we're done
}
Expand Down

0 comments on commit eb17c71

Please sign in to comment.