fix(PackProfile): overwrite update task when it has different network mode

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2026-03-19 10:54:15 +05:00
parent 04786023b0
commit cd006d642b
No known key found for this signature in database
GPG key ID: B77C34313AEE1FFF
4 changed files with 16 additions and 2 deletions

View file

@ -326,7 +326,15 @@ PackProfile::Result PackProfile::reload(Net::Mode netmode)
{
// Do not reload when the update/resolve task is running. It is in control.
if (d->m_updateTask) {
return Result::Success();
if (d->m_updateTask->netMode() == netmode) {
return Result::Success();
}
// https://github.com/PrismLauncher/PrismLauncher/issues/5209
// FIXME: HACK HACK HACK
disconnect(d->m_updateTask.get(), &ComponentUpdateTask::aborted, nullptr, nullptr);
d->m_updateTask->abort();
d->m_updateTask.reset();
}
// flush any scheduled saves to not lose state