Prevent multiple unsubscribe calls for ActionCable
This commit is contained in:
@ -1089,8 +1089,8 @@ var CodeOceanEditor = {
|
||||
this.initializeDeadlines();
|
||||
CodeOceanEditorTips.initializeEventHandlers();
|
||||
|
||||
window.addEventListener("turbolinks:before-render", App.synchronized_editor?.unsubscribe.bind(App.synchronized_editor));
|
||||
window.addEventListener("beforeunload", App.synchronized_editor?.unsubscribe.bind(App.synchronized_editor));
|
||||
window.addEventListener("turbolinks:before-render", App.synchronized_editor?.disconnect.bind(App.synchronized_editor));
|
||||
window.addEventListener("beforeunload", App.synchronized_editor?.disconnect.bind(App.synchronized_editor));
|
||||
|
||||
window.addEventListener("turbolinks:before-render", this.autosaveIfChanged.bind(this));
|
||||
window.addEventListener("beforeunload", this.autosaveIfChanged.bind(this));
|
||||
|
@ -204,7 +204,7 @@ CodeOceanEditorSubmissions = {
|
||||
this.teardownEventHandlers();
|
||||
this.createSubmission(button, null, function (response) {
|
||||
if (response.redirect) {
|
||||
App.synchronized_editor?.unsubscribe();
|
||||
App.synchronized_editor?.disconnect();
|
||||
this.autosaveIfChanged();
|
||||
this.stopCode(event);
|
||||
this.editors = [];
|
||||
|
Reference in New Issue
Block a user