Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes publish Swarm #2006

Merged
merged 3 commits into from
May 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/app/tabs/compile-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,17 @@ class CompileTab extends CompilerApi {
* @param {string[]} contractList Names of the compiled contracts
*/
contractSelection (contractList = [], sourceFile) {
return contractList.length !== 0
let selectEl = yo`
<select onchange="${e => this.selectContract(e.target.value)}" id="compiledContracts" class="custom-select">
${contractList.map((name) => yo`<option value="${name}">${name}</option>`)}
</select>
`
let result = contractList.length !== 0
? yo`<section class="${css.container} clearfix">
<!-- Select Compiler Version -->
<div class="navbar navbar-light bg-light input-group mb-3">
<label class="border-0 input-group-text" for="compiledContracts">Contract</label>
<select onchange="${e => this.selectContract(e.target.value)}" onload="${e => { this.selectedContract = e.value }}" id="compiledContracts" class="custom-select">
${contractList.map((name) => yo`<option value="${name}">${name}</option>`)}
</select>
<label class="border-0 input-group-text" for="compiledContracts">Contract</label>
${selectEl}
</div>

<article class="${css.compilerArticle}">
Expand Down Expand Up @@ -220,6 +223,10 @@ class CompileTab extends CompilerApi {
: yo`<section class="${css.container} clearfix"><article class="${css.compilerArticle}">
<span class="alert alert-warning" role="alert">No Contract Compiled Yet</span>
</article></section>`

if (0 !== contractList.length)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better check with if (!contractList.length)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we reset this.selectedContract if not contract is compiled

this.selectedContract = selectEl.value
return result;
}

// TODO : Add success alert when compilation succeed
Expand Down