From ed29fce333dbcaeb7bd090bba295b3fd70433d85 Mon Sep 17 00:00:00 2001
From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr>
Date: Mon, 23 Jan 2023 16:39:41 +0100
Subject: [PATCH] WIP adding resource in catalog

---
 src/CanvasListItem.js | 5 +++--
 src/utils.js          | 2 --
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/CanvasListItem.js b/src/CanvasListItem.js
index 2e0755b..e2e5bd1 100644
--- a/src/CanvasListItem.js
+++ b/src/CanvasListItem.js
@@ -84,7 +84,8 @@ class CanvasListItem extends Component {
   /** */
   handleOpenOtherManifest(manifestId) {
     console.log('Opening TODO');
-    actions.addResource(manifestId);
+    let result = actions.addResource(manifestId);
+    console.log(result);
   }
 
   /** */
@@ -151,7 +152,7 @@ class CanvasListItem extends Component {
           {children}
         </li>
         <div>
-          {manifests.length
+          {manifests.length > 0
               && manifests.map((o) => (
                 <button value={o} onClick={(e) => this.handleOpenOtherManifest(e.target.value)}> Ouvrir {o} </button>))
           }
diff --git a/src/utils.js b/src/utils.js
index 7469abc..0b38c7e 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -43,8 +43,6 @@ export async function searchManifestAndAddButton(html) {
           return data.id;
         }
         return null;
-      }).then((data) => {
-        console.log('Failed to Fatch')
       });
     }));
   }
-- 
GitLab