1
mirror of https://github.com/thepeacockproject/Peacock synced 2025-02-10 05:24:28 +01:00

Fix paginating of fake contracts

This commit is contained in:
Reece Dunham 2022-12-22 14:49:04 -05:00
parent 79558dd4a6
commit 193df194c5
2 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,10 @@ function paginate<Element>(
}
for (let j = index; j < condition; j++) {
if (!elements[j]) {
break
}
perPageArray.push(elements[j])
}

View File

@ -771,6 +771,9 @@ export class Controller {
* @internal
*/
index(): void {
this.contracts.clear()
this._pubIdToContractId.clear()
const contracts = readdirSync("contracts")
contracts.forEach((i) => {
if (!isContractFile(i)) {
@ -788,7 +791,7 @@ export class Controller {
}
this.contracts.set(f.Metadata.Id, f)
if (f.Metadata.PublicId && f.Metadata.PublicId !== "") {
if (f.Metadata.PublicId) {
this._pubIdToContractId.set(
f.Metadata.PublicId,
f.Metadata.Id,