force online in case the offline load failed

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-06-22 12:33:32 +03:00
parent 2af6902b42
commit 06e1cab41f
4 changed files with 25 additions and 7 deletions

View File

@@ -122,7 +122,10 @@ void BaseEntityLoadTask::executeTask()
}
}
// if we need remote update, run the update task
if (m_mode == Net::Mode::Offline || (!m_entity->m_sha256.isEmpty() && m_entity->m_sha256 == m_entity->m_file_sha256)) {
auto hashMatches = !m_entity->m_sha256.isEmpty() && m_entity->m_sha256 == m_entity->m_file_sha256;
auto wasLoadedOffline = m_entity->m_load_status != BaseEntity::LoadStatus::NotLoaded && m_mode == Net::Mode::Offline;
if (wasLoadedOffline || hashMatches) {
m_entity->m_load_status = BaseEntity::LoadStatus::Local;
emitSucceeded();
return;
}