From 1487c78466521e866d83a59797e1dab221523301 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Thu, 12 Feb 2026 16:16:53 -0600 Subject: [PATCH] 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 --- src/contract/contractSettings.tsx | 2 +- src/pages/Contracts.tsx | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/contract/contractSettings.tsx b/src/contract/contractSettings.tsx index d52fb15..097c9d5 100644 --- a/src/contract/contractSettings.tsx +++ b/src/contract/contractSettings.tsx @@ -402,7 +402,7 @@ export default function ContractSettings(props: Props) { borderRadius: 5, margin: 20 }}> - Note: When delivering grain on contract from a field or a bin the Grain Types must match + Note: When delivering grain on contract from a field or a bin the Grain Types must match, if it is a custom type the names must match. { let contracts: Contract[] = []; let contractPermissions: Map = 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 => {});