fixed bug where the linear progress never went away because the loading boolean was never being reset when no contracts were loaded, also added to the note in the contracts that the names of custom types have to match

This commit is contained in:
csawatzky 2026-02-12 16:16:53 -06:00
parent b5f6139bc0
commit 1487c78466
2 changed files with 13 additions and 11 deletions

View file

@ -40,16 +40,18 @@ export default function Contracts() {
.then(resp => {
let contracts: Contract[] = [];
let contractPermissions: Map<string, pond.Permission[]> = new Map();
resp.data.contracts.forEach(contract => {
let c = Contract.create(contract);
contracts.push(c);
let p = pond.EvaluatePermissionsResponse.fromObject(
resp.data.contractPermissions[c.key()]
);
contractPermissions.set(c.key(), p.permissions);
});
setContracts(contracts);
setContractPermissions(contractPermissions);
if (resp.data.contracts){
resp.data.contracts.forEach(contract => {
let c = Contract.create(contract);
contracts.push(c);
let p = pond.EvaluatePermissionsResponse.fromObject(
resp.data.contractPermissions[c.key()]
);
contractPermissions.set(c.key(), p.permissions);
});
setContracts(contracts);
setContractPermissions(contractPermissions);
}
setLoading(false);
})
.catch(err => {});