mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-15 22:01:56 +00:00
Readd resetAutoSaveCountDown for more deterministic saving ops
This commit is contained in:
parent
31835c9140
commit
635d83e1b3
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div (keyup)="setCodeState('DIRTY'); setDeployButtonState('TODEPLOY')"
|
||||
<div (keyup)="setCodeState('DIRTY'); setDeployButtonState('TODEPLOY'); resetAutoSaveCountdown()"
|
||||
ace-editor
|
||||
[(text)]="code"
|
||||
[mode]="language"
|
||||
|
@ -55,7 +55,7 @@ export class WebideComponent implements OnInit {
|
||||
this.processManagerService.init();
|
||||
this.processManagerService.subscribeCallback(config.webide.deployProcessName, (event) => { this.setDeployButtonState('DEPLOYED'); });
|
||||
this.processManagerService.subscribeErrorCallback(config.webide.deployProcessName, (event) => { this.setDeployButtonState('FAILED'); });
|
||||
setInterval(() => { this.sendCodeIfDirty(); }, config.webide.autoSaveInterval);
|
||||
this.resetAutoSaveCountdown();
|
||||
}
|
||||
|
||||
subscribeWS() {
|
||||
@ -95,6 +95,13 @@ 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();
|
||||
|
Loading…
Reference in New Issue
Block a user