mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-13 03:51:10 +00:00
fix: keep a Proton's originals when its folder could not be fully removed
This commit is contained in:
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user