Skip to content

Commit

Permalink
pass the account's contracts code as one combined string
Browse files Browse the repository at this point in the history
pass the account's contracts code as one combined string to Cadence server for check

this fix the frontend warning for missing declarations
  • Loading branch information
soetop committed Nov 17, 2021
1 parent 29a6901 commit ce3efb7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/containers/Editor/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,17 @@ const EditorContainer: React.FC<EditorContainerProps> = ({
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 (
Expand Down

0 comments on commit ce3efb7

Please sign in to comment.