Skip to content

Commit

Permalink
Merge pull request ethereum#595 from ethereum/fixCompilationSlowWarning
Browse files Browse the repository at this point in the history
fix compilation slow warning
  • Loading branch information
yann300 authored Jun 15, 2017
2 parents dc537b5 + 5de2eff commit c334789
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/settings-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ function SettingsTab (container, appAPI, appEvents, opts) {
if (!container) throw new Error('no container given')

var warnCompilationSlow = yo`<div id="warnCompilationSlow"></div>`

warnCompilationSlow.className = css.compilationWarning
appEvents.compiler.register('compilationDuration', function tabHighlighting (speed) {
var settingsView = document.querySelector('#header #menu .settingsView')
if (speed > 1000) {
warnCompilationSlow.className = css.compilationWarning
warnCompilationSlow.innerHTML = `Last compilation took ${speed}ms. We suggest to turn off autocompilation.`
warnCompilationSlow.style.visibility = 'visible'
settingsView.style.color = '#FF8B8B'
} else {
warnCompilationSlow.innerHTML = ''
warnCompilationSlow.style.visibility = 'hidden'
settingsView.style.color = ''
}
})

Expand Down

0 comments on commit c334789

Please sign in to comment.