3
0
Fork 0

Allow deletion of managed sites on Android (#94)

This commit is contained in:
John Maguire 2022-11-18 16:18:07 -05:00 committed by GitHub
parent 974c7a4eed
commit a5ec4f5ed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -49,7 +49,11 @@ class Sites(private var engine: FlutterEngine) {
}
fun deleteSite(id: String) {
val siteDir = MainActivity.getContext()!!.filesDir.resolve("sites").resolve(id)
val context = MainActivity.getContext()!!
val site = containers[id]!!.site
val baseDir = if(site.managed == true) context.noBackupFilesDir else context.filesDir
val siteDir = baseDir.resolve("sites").resolve(id)
siteDir.deleteRecursively()
refreshSites()
//TODO: make sure you stop the vpn