mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
fix: cancel Proton seed downloads promptly
This commit is contained in:
1 parent
c02832ac59
commit
0ab2172857
3 files changed
+25
-4
No files matched your search
@@ -1452,7 +1452,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
val catalog = com.droiddeck.launcher.runtime.DesktopCatalog
|
||||
val entry = catalog.fetch(catalog.STEAM_SEED_URL)?.firstOrNull { it.id == catalog.PROTON_SEED_ID }
|
||||
?: return "catalog unreachable"
|
||||
return catalog.install(this, entry, { SessionState.stopRequested }, progressFor(PROTON_LINES, entry.size / 1_000_000))
|
||||
val cancellation = com.droiddeck.launcher.core.Downloader.Cancellation { SessionState.stopRequested }
|
||||
SessionState.installCancellation = cancellation
|
||||
return try {
|
||||
catalog.install(this, entry, cancellation, progressFor(PROTON_LINES, entry.size / 1_000_000))
|
||||
} finally {
|
||||
if (SessionState.installCancellation === cancellation) SessionState.installCancellation = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun surfaceCreated(holder: SurfaceHolder) {
|
||||
|
||||
Reference in new issue
Block a user