From b5dc8b8192c8116707ec1db0e7f8bdf2c0c4512b Mon Sep 17 00:00:00 2001 From: Guillaume Levrier Date: Fri, 19 Jan 2024 13:07:22 +0100 Subject: [PATCH] better loading collections --- js/chaeros.js | 11 +++++++++++ js/preload-chaeros.js | 11 +++++++++++ js/preload-index.js | 6 ------ js/types.js | 6 ------ 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/js/chaeros.js b/js/chaeros.js index 26fb9b2..53075cb 100644 --- a/js/chaeros.js +++ b/js/chaeros.js @@ -1206,6 +1206,8 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => { "Creating collection " + collectionName ); // Send message to main Display + const colName=collectionName; + pandodb.csljson.get(id).then((data) => { var file = data.content; @@ -1270,6 +1272,8 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => { let resultList = []; + let count = 0 + fetchTargets.forEach((d) => { limiter .schedule(() => @@ -1281,6 +1285,13 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => { .then((res) => res.json()) .then((result) => { resultList.push(result); + + count++ + + ipcRenderer.send( + "chaeros-notification", + `Uploading ${colName} - (${count}/${fileArrays.length})` + ); if (resultList.length === fileArrays.length) { setTimeout(() => { ipcRenderer.send( diff --git a/js/preload-chaeros.js b/js/preload-chaeros.js index 3100531..846a62b 100644 --- a/js/preload-chaeros.js +++ b/js/preload-chaeros.js @@ -1422,6 +1422,8 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => { "Creating collection " + collectionName ); // Send message to main Display + const colName=collectionName; + pandodb.csljson.get(id).then((data) => { var file = data.content; @@ -1486,6 +1488,8 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => { let resultList = []; + let count = 0 + fetchTargets.forEach((d) => { limiter .schedule(() => @@ -1497,6 +1501,13 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => { .then((res) => res.json()) .then((result) => { resultList.push(result); + + count++ + + ipcRenderer.send( + "chaeros-notification", + `Uploading ${colName} - (${count}/${fileArrays.length})` + ); if (resultList.length === fileArrays.length) { setTimeout(() => { ipcRenderer.send( diff --git a/js/preload-index.js b/js/preload-index.js index c65c885..065e57e 100644 --- a/js/preload-index.js +++ b/js/preload-index.js @@ -2956,13 +2956,8 @@ const archotype = (id) => { toolSearch.type = "text"; toolSearch.placeholder = "target expression" - - const toolContent = document.createElement("div"); - - - if (resolver) { node.on("click", (e, d) => { @@ -2971,7 +2966,6 @@ const archotype = (id) => { const collection = documentMap[d.id].enrichment.solrCollection; - d.domain ? 0 : fetch( diff --git a/js/types.js b/js/types.js index 9dd83ae..84de6c6 100644 --- a/js/types.js +++ b/js/types.js @@ -794,13 +794,8 @@ const archotype = (id) => { toolSearch.type = "text"; toolSearch.placeholder = "target expression" - - const toolContent = document.createElement("div"); - - - if (resolver) { node.on("click", (e, d) => { @@ -809,7 +804,6 @@ const archotype = (id) => { const collection = documentMap[d.id].enrichment.solrCollection; - d.domain ? 0 : fetch(