From ce3efb7d3e6c6b59492cea1093f88f436bc35a71 Mon Sep 17 00:00:00 2001 From: soetop <81572453+soetop@users.noreply.github.com> Date: Wed, 17 Nov 2021 23:15:09 +0630 Subject: [PATCH] pass the account's contracts code as one combined string pass the account's contracts code as one combined string to Cadence server for check this fix the frontend warning for missing declarations --- src/containers/Editor/components.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/containers/Editor/components.tsx b/src/containers/Editor/components.tsx index dbfaaa72..69d0b5a1 100644 --- a/src/containers/Editor/components.tsx +++ b/src/containers/Editor/components.tsx @@ -187,7 +187,17 @@ const EditorContainer: React.FC = ({ if (index < 0 || index >= project.accounts.length) { return } - return project.accounts[index].draftCode + + // combine the account's contracts as one string + // and return for cadence server check + var combinedCode = ''; + for (let i = 0; i < project.contracts.length; i++) { + if(project.contracts[i].index == index) { + combinedCode += project.contracts[i].script; + } + } + + return combinedCode; } return (