check for current for ctrl + s

pull/1780/head
lianahus 3 years ago
parent 2be317f0f7
commit 04afe562f5
  1. 4
      apps/solidity-compiler/src/app/compiler-api.ts

@ -288,11 +288,11 @@ export const CompilerApiMixin = (Base) => class extends Base {
} }
} }
this.on('themeModule', 'themeChanged', this.data.eventHandlers.onThemeChanged) this.on('themeModule', 'themeChanged', this.data.eventHandlers.onThemeChanged)
// Run the compiler instead of trying to save the website // Run the compiler instead of trying to save the website
this.data.eventHandlers.onKeyDown = (e) => { this.data.eventHandlers.onKeyDown = (e) => {
// ctrl+s or command+s // ctrl+s or command+s
if ((e.metaKey || e.ctrlKey) && e.keyCode === 83) { if ((e.metaKey || e.ctrlKey) && e.keyCode === 83 && this.currentFile !== '') {
e.preventDefault() e.preventDefault()
this.compileTabLogic.runCompiler(this.getAppParameter('hardhat-compilation')) this.compileTabLogic.runCompiler(this.getAppParameter('hardhat-compilation'))
} }

Loading…
Cancel
Save