Commit 240d262d authored by Filipa Lacerda's avatar Filipa Lacerda

Only starts autosave if user is logged in

parent fdfab012
......@@ -35,7 +35,10 @@ window.Autosave = (function() {
// v-model does not update with jQuery trigger
// https://github.com/vuejs/vue/issues/2804#issuecomment-216968137
const event = new Event('change', { bubbles: true, cancelable: false });
this.field.get(0).dispatchEvent(event);
const field = this.field.get(0);
if (field) {
field.dispatchEvent(event);
}
}
};
......
......@@ -184,7 +184,9 @@
}
},
initAutoSave() {
if (this.isLoggedIn) {
this.autosave = new Autosave($(this.$refs.textarea), ['Note', 'Issue', this.getIssueData.id], 'issue');
}
},
initTaskList() {
return new TaskList({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment