fix: keep a Proton's originals when its folder could not be fully removed

This commit is contained in:
maxjivi05 authored and MaxsTechReview committed 2026-10-24 08:22:00 -04:00
1 parent ad6d8d824a
commit 0790cb4390
1 file changed
+2 -4
@@ -136,14 +136,12 @@ object ProtonExtras {
fun remove(context: Context, tool: Tool, dir: String? = null) {
val name = if (dir != null) dir.takeIf { it in installedAll(context, tool) } ?: return else installed(context, tool) ?: return
File(toolsDir(context), name).deleteRecursively()
ComponentsManager.forgetProton(context, name)
if (File(toolsDir(context), name).deleteRecursively()) ComponentsManager.forgetProton(context, name)
}
fun removeOlder(context: Context, tool: Tool) {
installedAll(context, tool).dropLast(1).forEach {
File(toolsDir(context), it).deleteRecursively()
ComponentsManager.forgetProton(context, it)
if (File(toolsDir(context), it).deleteRecursively()) ComponentsManager.forgetProton(context, it)
}
}