Fixed wrong version info

This commit is contained in:
timoreo 2022-02-27 11:55:24 +01:00
parent 84e9ce71b0
commit 2745325ae0
No known key found for this signature in database
GPG Key ID: 121A72C3512BA288
3 changed files with 12 additions and 3 deletions

View File

@ -118,7 +118,10 @@ void FlameModPage::onSelectionChanged(QModelIndex first, QModelIndex second) {
.arg(addonId),
response));
QObject::connect(netJob, &NetJob::succeeded, this, [this, response] {
QObject::connect(netJob, &NetJob::succeeded, this, [this, response, addonId] {
if(addonId != current.addonId){
return; //wrong request
}
QJsonParseError parse_error;
QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error);
if (parse_error.error != QJsonParseError::NoError) {

View File

@ -114,8 +114,11 @@ void FlamePage::onSelectionChanged(QModelIndex first, QModelIndex second)
int addonId = current.addonId;
netJob->addNetAction(Net::Download::makeByteArray(QString("https://addons-ecs.forgesvc.net/api/v2/addon/%1/files").arg(addonId), response.get()));
QObject::connect(netJob, &NetJob::succeeded, this, [this, response]
QObject::connect(netJob, &NetJob::succeeded, this, [this, response, addonId]
{
if(addonId != current.addonId){
return; //wrong request
}
QJsonParseError parse_error;
QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error);
if(parse_error.error != QJsonParseError::NoError) {

View File

@ -103,7 +103,10 @@ void ModrinthPage::onSelectionChanged(QModelIndex first, QModelIndex second) {
QString("https://api.modrinth.com/v2/project/%1/version").arg(addonId),
response));
QObject::connect(netJob, &NetJob::succeeded, this, [this, response] {
QObject::connect(netJob, &NetJob::succeeded, this, [this, response, addonId] {
if(addonId != current.addonId){
return;
}
QJsonParseError parse_error;
QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error);
if (parse_error.error != QJsonParseError::NoError) {