Skip to content
Snippets Groups Projects
Verified Commit aaa304d4 authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

fix: use already initialized projectlist variable

parent af357313
No related branches found
No related tags found
No related merge requests found
Pipeline #67392 passed
...@@ -408,22 +408,10 @@ void Backend::runUserProject(const QString &projectName) ...@@ -408,22 +408,10 @@ void Backend::runUserProject(const QString &projectName)
qDebug() << "Running user project:" << projectName; qDebug() << "Running user project:" << projectName;
const QString userHash = Backend::userHash();
qDebug("Checking if project is cached. Getting list of available projects...");
const std::optional<QJsonArray> projectList = m_serviceConnector.fetchUserProjectList(userHash);
if (projectList == std::nullopt) {
qCritical() << "Could not fetch up-to-date project information. Please check your internet "
"connection and try again.";
emit popupClose();
return;
}
QString projectLastModified; QString projectLastModified;
QString projectId; QString projectId;
QJsonObject projectInfo; QJsonObject projectInfo;
for (auto project : projectList.value()) { for (const auto &project : m_projectList) {
if (projectName == project.toObject().value("appName").toString()) { if (projectName == project.toObject().value("appName").toString()) {
projectInfo = project.toObject(); projectInfo = project.toObject();
break; break;
...@@ -436,7 +424,7 @@ void Backend::runUserProject(const QString &projectName) ...@@ -436,7 +424,7 @@ void Backend::runUserProject(const QString &projectName)
qDebug("Project is not cached. Downloading..."); qDebug("Project is not cached. Downloading...");
updatePopup("Project is not cached. Downloading...", false); updatePopup("Project is not cached. Downloading...", false);
const std::optional<QByteArray> projectData const std::optional<QByteArray> projectData
= m_serviceConnector.fetchUserProject(userHash, projectName); = m_serviceConnector.fetchUserProject(userHash(), projectName);
if (projectData == std::nullopt) { if (projectData == std::nullopt) {
qCritical() qCritical()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment