Allow deletion of managed sites on Android (#94)
This commit is contained in:
parent
974c7a4eed
commit
a5ec4f5ed5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue