allow uninstall even if app is not installed (bad state)

This commit is contained in:
Nicolas Meienberger 2022-07-18 18:57:14 +02:00
parent c8680f0bd2
commit 06fcaeb13a
2 changed files with 8 additions and 1 deletions
apps/anonaddy
packages/system-api/src/modules/apps

View file

@ -1,6 +1,8 @@
{
"name": "Anonaddy",
"port": 8084,
"available": false,
"categories": ["utilities"],
"id": "anonaddy",
"description": "",
"short_desc": "Anonymous email forwarding",

View file

@ -134,7 +134,12 @@ const uninstallApp = async (id: string): Promise<App> => {
await App.update({ id }, { status: AppStatusEnum.UNINSTALLING });
// Run script
await runAppScript(['uninstall', id]);
try {
await runAppScript(['uninstall', id]);
} catch (e) {
console.log(e);
}
await App.delete({ id });
return { id, status: AppStatusEnum.MISSING, config: {} } as App;