Ensure to clear timeout in autosave

We are still trying to ensure autosave is not called outside the /implement route.

Relates to CODEOCEAN-G1
This commit is contained in:
Sebastian Serth
2023-02-28 12:31:22 +01:00
parent 6c1bfb6815
commit 252704b083
2 changed files with 11 additions and 10 deletions

View File

@ -988,8 +988,8 @@ var CodeOceanEditor = {
this.initializeDeadlines();
CodeOceanEditorTips.initializeEventHandlers();
window.addEventListener("turbolinks:before-render", this.unloadAutoSave.bind(this));
window.addEventListener("beforeunload", this.unloadAutoSave.bind(this));
window.addEventListener("turbolinks:before-render", this.autosaveIfChanged.bind(this));
window.addEventListener("beforeunload", this.autosaveIfChanged.bind(this));
// create autosave when the editor is opened the first time
this.autosave();
}