Commit 25133a37 authored by Winnie Hellmann's avatar Winnie Hellmann

Remove autosave logic from NoteableDiscussion component

parent 53e23a29
...@@ -4,7 +4,7 @@ import { mapActions, mapGetters } from 'vuex'; ...@@ -4,7 +4,7 @@ import { mapActions, mapGetters } from 'vuex';
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective } from '@gitlab/ui';
import { truncateSha } from '~/lib/utils/text_utility'; import { truncateSha } from '~/lib/utils/text_utility';
import { s__, __, sprintf } from '~/locale'; import { s__, __, sprintf } from '~/locale';
import { getDiscussionReplyKey } from '~/lib/utils/autosave'; import { clearDraft, getDiscussionReplyKey } from '~/lib/utils/autosave';
import systemNote from '~/vue_shared/components/notes/system_note.vue'; import systemNote from '~/vue_shared/components/notes/system_note.vue';
import icon from '~/vue_shared/components/icon.vue'; import icon from '~/vue_shared/components/icon.vue';
import diffLineNoteFormMixin from 'ee_else_ce/notes/mixins/diff_line_note_form'; import diffLineNoteFormMixin from 'ee_else_ce/notes/mixins/diff_line_note_form';
...@@ -22,7 +22,6 @@ import noteForm from './note_form.vue'; ...@@ -22,7 +22,6 @@ import noteForm from './note_form.vue';
import diffWithNote from './diff_with_note.vue'; import diffWithNote from './diff_with_note.vue';
import placeholderNote from '../../vue_shared/components/notes/placeholder_note.vue'; import placeholderNote from '../../vue_shared/components/notes/placeholder_note.vue';
import placeholderSystemNote from '../../vue_shared/components/notes/placeholder_system_note.vue'; import placeholderSystemNote from '../../vue_shared/components/notes/placeholder_system_note.vue';
import autosave from '../mixins/autosave';
import noteable from '../mixins/noteable'; import noteable from '../mixins/noteable';
import resolvable from '../mixins/resolvable'; import resolvable from '../mixins/resolvable';
import discussionNavigation from '../mixins/discussion_navigation'; import discussionNavigation from '../mixins/discussion_navigation';
...@@ -55,7 +54,7 @@ export default { ...@@ -55,7 +54,7 @@ export default {
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [autosave, noteable, resolvable, discussionNavigation, diffLineNoteFormMixin], mixins: [noteable, resolvable, discussionNavigation, diffLineNoteFormMixin],
props: { props: {
discussion: { discussion: {
type: Object, type: Object,
...@@ -246,18 +245,6 @@ export default { ...@@ -246,18 +245,6 @@ export default {
return !this.discussionResolved && this.discussion.resolve_with_issue_path; return !this.discussionResolved && this.discussion.resolve_with_issue_path;
}, },
}, },
watch: {
isReplying() {
if (this.isReplying) {
this.$nextTick(() => {
// Pass an extra key to separate reply and note edit forms
this.initAutoSave({ ...this.firstNote, ...this.discussion }, ['Reply']);
});
} else {
this.disposeAutoSave();
}
},
},
created() { created() {
eventHub.$on('startReplying', this.onStartReplying); eventHub.$on('startReplying', this.onStartReplying);
}, },
...@@ -316,7 +303,7 @@ export default { ...@@ -316,7 +303,7 @@ export default {
} }
this.isReplying = false; this.isReplying = false;
this.resetAutoSave(); clearDraft(this.autosaveKey);
}, },
saveReply(noteText, form, callback) { saveReply(noteText, form, callback) {
const postData = { const postData = {
...@@ -342,7 +329,7 @@ export default { ...@@ -342,7 +329,7 @@ export default {
this.isReplying = false; this.isReplying = false;
this.saveNote(replyData) this.saveNote(replyData)
.then(() => { .then(() => {
this.resetAutoSave(); clearDraft(this.autosaveKey);
callback(); callback();
}) })
.catch(err => { .catch(err => {
......
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