提交 240d262d 编写于 作者: F Filipa Lacerda

Only starts autosave if user is logged in

上级 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() {
this.autosave = new Autosave($(this.$refs.textarea), ['Note', 'Issue', this.getIssueData.id], 'issue');
if (this.isLoggedIn) {
this.autosave = new Autosave($(this.$refs.textarea), ['Note', 'Issue', this.getIssueData.id], 'issue');
}
},
initTaskList() {
return new TaskList({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册