Skip to content

Commit

Permalink
better loading collections
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume-Levrier committed Jan 19, 2024
1 parent b783dcf commit b5dc8b8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
11 changes: 11 additions & 0 deletions js/chaeros.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -1270,6 +1272,8 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => {

let resultList = [];

let count = 0

fetchTargets.forEach((d) => {
limiter
.schedule(() =>
Expand All @@ -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(
Expand Down
11 changes: 11 additions & 0 deletions js/preload-chaeros.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -1486,6 +1488,8 @@ const zoteroCollectionBuilder = (collectionName, zoteroUser, id) => {

let resultList = [];

let count = 0

fetchTargets.forEach((d) => {
limiter
.schedule(() =>
Expand All @@ -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(
Expand Down
6 changes: 0 additions & 6 deletions js/preload-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {

Expand All @@ -2971,7 +2966,6 @@ const archotype = (id) => {

const collection = documentMap[d.id].enrichment.solrCollection;


d.domain
? 0
: fetch(
Expand Down
6 changes: 0 additions & 6 deletions js/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {

Expand All @@ -809,7 +804,6 @@ const archotype = (id) => {

const collection = documentMap[d.id].enrichment.solrCollection;


d.domain
? 0
: fetch(
Expand Down

0 comments on commit b5dc8b8

Please sign in to comment.