diff --git a/lib/core/engine.js b/lib/core/engine.js index da5c71695..18bb66823 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -224,22 +224,22 @@ class Engine { }); this.events.on('file-event', function (fileType) { - // TODO: still need to redeploy contracts because the original contracts - // config is being corrupted - if (fileType === 'asset') { - // Throttle file changes so we re-write only once for all files - clearTimeout(self.fileTimeout); - self.fileTimeout = setTimeout(() => { + clearTimeout(self.fileTimeout); + self.fileTimeout = setTimeout(() => { + // TODO: still need to redeploy contracts because the original contracts + // config is being corrupted + if (fileType === 'asset') { + // Throttle file changes so we re-write only once for all files self.events.emit('asset-changed', self.contractsManager); - }, 50); - } - // TODO: for now need to deploy on asset changes as well - // because the contractsManager config is corrupted after a deploy - if (fileType === 'contract' || fileType === 'config') { - self.config.reloadConfig(); - self.deployManager.deployContracts(function () { - }); - } + } + // TODO: for now need to deploy on asset changes as well + // because the contractsManager config is corrupted after a deploy + if (fileType === 'contract' || fileType === 'config') { + self.config.reloadConfig(); + self.deployManager.deployContracts(function () { + }); + } + }, 50); }); }