diff --git a/src/app/webide/webide.component.html b/src/app/webide/webide.component.html index 937d2c1..bccf916 100644 --- a/src/app/webide/webide.component.html +++ b/src/app/webide/webide.component.html @@ -34,7 +34,7 @@ -
{ this.setDeployButtonState('DEPLOYED'); }); this.processManagerService.subscribeErrorCallback(config.webide.deployProcessName, (event) => { this.setDeployButtonState('FAILED'); }); - this.resetAutoSaveCountdown(); + setInterval(() => { this.sendCodeIfDirty(); }, config.webide.autoSaveInterval); } subscribeWS() { @@ -82,8 +82,9 @@ export class WebideComponent implements OnInit { } readHandler(data: SourceCode) { - this.updateFileData(data); - this.setCodeState('SAVED'); + if (this.codeState == 'SAVED') { + this.updateFileData(data); + } } writeHandler() { @@ -94,13 +95,6 @@ export class WebideComponent implements OnInit { this.updateFileData(data); } - resetAutoSaveCountdown() { - if (this.autosave) { - clearInterval(this.autosave); - } - this.autosave = setInterval(() => { this.sendCodeIfDirty(); }, config.webide.autoSaveInterval); - } - tabSwitchButtonHandler(file) { if (this.codeState === 'DIRTY') { this.sendCodeContents();