mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-15 23:41:55 +00:00
Implement automatic saving
This commit is contained in:
parent
5918b300ef
commit
fc5a5b161b
@ -48,6 +48,7 @@ export class WebideComponent implements OnInit {
|
||||
this.requestCode();
|
||||
this.processManagerService.init();
|
||||
this.processManagerService.subscribeCallback('login', (event) => { this.setButtonStateSaved(); });
|
||||
setInterval(() => { this.sendCodeIfDirty(); }, 10000);
|
||||
}
|
||||
|
||||
subscribeWS() {
|
||||
@ -99,6 +100,12 @@ export class WebideComponent implements OnInit {
|
||||
this.processManagerService.restartProcess('login');
|
||||
}
|
||||
|
||||
sendCodeIfDirty() {
|
||||
if (this.saveButtonState === 'DIRTY') {
|
||||
this.sendCodeContents();
|
||||
}
|
||||
}
|
||||
|
||||
sendCodeContents() {
|
||||
this.webSocketService.send(this.key_id, {
|
||||
'command': 'write',
|
||||
|
Loading…
Reference in New Issue
Block a user