Only starts autosave if user is logged in
This commit is contained in:
parent
fdfab012f0
commit
240d262db3
2 changed files with 7 additions and 2 deletions
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue