summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-11-09 11:04:13 +0000
committerPhil Hughes <me@iamphill.com>2018-11-09 11:04:13 +0000
commit5796221bc4de2a498777a4a0abf1c3d5a2d35891 (patch)
tree8afd24fb62393da919127c891b2c9a4867cc216a /app/assets/javascripts
parentcfedc31b7a2595922e0aa19bf63a679fe0bd6669 (diff)
downloadgitlab-ce-5796221bc4de2a498777a4a0abf1c3d5a2d35891.tar.gz
Fix TaskList init on update & poll
Fixed duplicate TaskList requests being made
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/notes/components/comment_form.vue9
-rw-r--r--app/assets/javascripts/notes/stores/actions.js7
2 files changed, 5 insertions, 11 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue
index 754c6e79ee4..10e80883c00 100644
--- a/app/assets/javascripts/notes/components/comment_form.vue
+++ b/app/assets/javascripts/notes/components/comment_form.vue
@@ -6,7 +6,6 @@ import Autosize from 'autosize';
import { __, sprintf } from '~/locale';
import Flash from '../../flash';
import Autosave from '../../autosave';
-import TaskList from '../../task_list';
import {
capitalizeFirstCharacter,
convertToCamelCase,
@@ -146,7 +145,6 @@ export default {
});
this.initAutoSave();
- this.initTaskList();
},
methods: {
...mapActions([
@@ -298,13 +296,6 @@ Please check your network connection and try again.`;
]);
}
},
- initTaskList() {
- return new TaskList({
- dataType: 'note',
- fieldName: 'note',
- selector: '.notes',
- });
- },
resizeTextarea() {
this.$nextTick(() => {
Autosize.update(this.$refs.textarea);
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index e67b3a6a3f6..2f952bf819d 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -60,12 +60,13 @@ export const deleteNote = ({ commit, dispatch }, note) =>
dispatch('updateMergeRequestWidget');
});
-export const updateNote = ({ commit }, { endpoint, note }) =>
+export const updateNote = ({ commit, dispatch }, { endpoint, note }) =>
service
.updateNote(endpoint, note)
.then(res => res.json())
.then(res => {
commit(types.UPDATE_NOTE, res);
+ Vue.nextTick(() => dispatch('startTaskList'));
});
export const replyToDiscussion = ({ commit }, { endpoint, data }) =>
@@ -262,6 +263,8 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => {
commit(types.ADD_NEW_NOTE, note);
}
});
+
+ Vue.nextTick(() => dispatch('startTaskList'));
}
commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at);
@@ -375,7 +378,7 @@ export const startTaskList = ({ dispatch }) =>
dataType: 'note',
fieldName: 'note',
selector: '.notes .is-editable',
- onSuccess: () => Vue.$nextTick(() => dispatch('startTaskList')),
+ onSuccess: () => Vue.nextTick(() => dispatch('startTaskList')),
});
// prevent babel-plugin-rewire from generating an invalid default during karma tests