Commit ee3f813b authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Clear the requested sets, before they can be modified.

parent 24fbb860
......@@ -259,87 +259,94 @@ export class DataGetter {
empty = true
if (this.requestedActeursUids.size > 0) {
empty = false
const acteurs = await getActeurs([...this.requestedActeursUids])
const requestedActeursUids = [...this.requestedActeursUids]
this.requestedActeursUids.clear()
const acteurs = await getActeurs(requestedActeursUids)
for (const acteur of acteurs) {
this.addActeur(acteur)
}
this.visitedActeursUids = new Set([
...this.visitedActeursUids,
...this.requestedActeursUids,
...requestedActeursUids,
])
this.requestedActeursUids.clear()
}
if (this.requestedAmendementsUids.size > 0) {
empty = false
const amendements = await getAmendements([...this.requestedAmendementsUids])
const requestedAmendementsUids = [...this.requestedAmendementsUids]
this.requestedAmendementsUids.clear()
const amendements = await getAmendements(requestedAmendementsUids)
for (const amendement of amendements) {
this.addAmendement(amendement)
}
this.visitedAmendementsUids = new Set([
...this.visitedAmendementsUids,
...this.requestedAmendementsUids,
...requestedAmendementsUids,
])
this.requestedAmendementsUids.clear()
}
if (this.requestedDocumentsUids.size > 0) {
empty = false
const documents = await getDocuments([...this.requestedDocumentsUids])
const requestedDocumentsUids = [...this.requestedDocumentsUids]
this.requestedDocumentsUids.clear()
const documents = await getDocuments(requestedDocumentsUids)
for (const document of documents) {
this.addDocument(document)
}
this.visitedDocumentsUids = new Set([
...this.visitedDocumentsUids,
...this.requestedDocumentsUids,
...requestedDocumentsUids,
])
this.requestedDocumentsUids.clear()
}
if (this.requestedDossiersUids.size > 0) {
empty = false
const dossiers = await getDossiers([...this.requestedDossiersUids])
const requestedDossiersUids = [...this.requestedDossiersUids]
this.requestedDossiersUids.clear()
const dossiers = await getDossiers(requestedDossiersUids)
for (const dossier of dossiers) {
this.addDossier(dossier)
}
this.visitedDossiersUids = new Set([
...this.visitedDossiersUids,
...this.requestedDossiersUids,
...requestedDossiersUids,
])
this.requestedDossiersUids.clear()
}
if (this.requestedOrganesUids.size > 0) {
empty = false
const organes = await getOrganes([...this.requestedOrganesUids])
const requestedOrganesUids = [...this.requestedOrganesUids]
this.requestedOrganesUids.clear()
const organes = await getOrganes(requestedOrganesUids)
for (const organe of organes) {
this.addOrgane(organe)
}
this.visitedOrganesUids = new Set([
...this.visitedOrganesUids,
...this.requestedOrganesUids,
...requestedOrganesUids,
])
this.requestedOrganesUids.clear()
}
if (this.requestedReunionsUids.size > 0) {
empty = false
const reunions = await getReunions([...this.requestedReunionsUids])
const requestedReunionsUids = [...this.requestedReunionsUids]
this.requestedReunionsUids.clear()
const reunions = await getReunions(requestedReunionsUids)
for (const reunion of reunions) {
this.addReunion(reunion)
}
this.visitedReunionsUids = new Set([
...this.visitedReunionsUids,
...this.requestedReunionsUids,
...requestedReunionsUids,
])
this.requestedReunionsUids.clear()
}
if (this.requestedScrutinsUids.size > 0) {
empty = false
const scrutins = await getScrutins([...this.requestedScrutinsUids])
const requestedScrutinsUids = [...this.requestedScrutinsUids]
this.requestedScrutinsUids.clear()
const scrutins = await getScrutins(requestedScrutinsUids)
for (const scrutin of scrutins) {
this.addScrutin(scrutin)
}
this.visitedScrutinsUids = new Set([
...this.visitedScrutinsUids,
...this.requestedScrutinsUids,
...requestedScrutinsUids,
])
this.requestedScrutinsUids.clear()
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment