浏览代码

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

Nicolas Meienberger 3 年之前
父节点
当前提交
06fcaeb13a
共有 2 个文件被更改,包括 8 次插入1 次删除
  1. 2 0
      apps/anonaddy/config.json
  2. 6 1
      packages/system-api/src/modules/apps/apps.service.ts

+ 2 - 0
apps/anonaddy/config.json

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

+ 6 - 1
packages/system-api/src/modules/apps/apps.service.ts

@@ -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;