aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
authortimoreo <timo.oreo34@gmail.com>2022-02-27 11:55:24 +0100
committertimoreo <timo.oreo34@gmail.com>2022-02-27 11:55:24 +0100
commit2745325ae007315694064b158daa65a63abb8ad4 (patch)
tree88f790efe9117ad6942270de2075d99eea62179d /launcher/ui
parent84e9ce71b06f7f123eb0a600ccd9fa0700bae647 (diff)
downloadPrismLauncher-2745325ae007315694064b158daa65a63abb8ad4.tar.gz
PrismLauncher-2745325ae007315694064b158daa65a63abb8ad4.tar.bz2
PrismLauncher-2745325ae007315694064b158daa65a63abb8ad4.zip
Fixed wrong version info
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModPage.cpp5
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.cpp5
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp5
3 files changed, 12 insertions, 3 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp
index 6d33a6ac..114ac907 100644
--- a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp
@@ -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) {
diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
index 1138a298..c46b98b5 100644
--- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
@@ -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) {
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
index fc6aff96..35cd743a 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
@@ -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) {