Add a thing to remove apps from your app list. Should I have called in 'uninstall'?

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3916 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-06-20 18:13:19 +00:00
parent c9e01f220d
commit 718383205b
3 changed files with 46 additions and 1 deletions

View File

@ -366,6 +366,22 @@ function save(save_to) {
});
}
function deleteApp() {
let name = document.getElementById("name");
let path = name && name.value ? name.value : url();
if (confirm(`Are you sure you want to delete the app '${path}'?`)) {
fetch(path + 'delete').then(function(response) {
if (!response.ok) {
throw new Error(response.status + ' ' + response.statusText);
}
alert('Deleted.');
}).catch(function(error) {
alert(error);
});
}
}
function pullFromParent() {
load(gParentApp ? gParentApp.path : null).then(x => save()).catch(function(error) {
alert(error)