mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 04:51:57 +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.requestCode();
|
||||||
this.processManagerService.init();
|
this.processManagerService.init();
|
||||||
this.processManagerService.subscribeCallback('login', (event) => { this.setButtonStateSaved(); });
|
this.processManagerService.subscribeCallback('login', (event) => { this.setButtonStateSaved(); });
|
||||||
|
setInterval(() => { this.sendCodeIfDirty(); }, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribeWS() {
|
subscribeWS() {
|
||||||
@ -99,6 +100,12 @@ export class WebideComponent implements OnInit {
|
|||||||
this.processManagerService.restartProcess('login');
|
this.processManagerService.restartProcess('login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendCodeIfDirty() {
|
||||||
|
if (this.saveButtonState === 'DIRTY') {
|
||||||
|
this.sendCodeContents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sendCodeContents() {
|
sendCodeContents() {
|
||||||
this.webSocketService.send(this.key_id, {
|
this.webSocketService.send(this.key_id, {
|
||||||
'command': 'write',
|
'command': 'write',
|
||||||
|
Loading…
Reference in New Issue
Block a user