diff --git a/web/pages/contract/index.tsx b/web/pages/contract/index.tsx index f283c230..b164f6d0 100644 --- a/web/pages/contract/index.tsx +++ b/web/pages/contract/index.tsx @@ -89,7 +89,11 @@ export default function NewContract() { const [contracts, setContracts] = useState([]) useEffect(() => { if (creator?.id) { - setContract({ ...contract, creatorId: creator.id }) + setContract((contract) => ({ + ...contract, + creatorId: creator.id, + creatorName: creator.name, + })) listContracts(creator?.id).then(setContracts) } }, [creator?.id]) @@ -97,7 +101,7 @@ export default function NewContract() { async function saveContract() { await pushContract(contract) // Update local contract list - setContracts([...contracts, { ...contract }]) + setContracts([{ ...contract }, ...contracts]) } function saveField(field: keyof Contract) {