summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-11-09 14:46:15 +0000
committerPhil Hughes <me@iamphill.com>2018-11-09 14:46:15 +0000
commita19c83dd7aa35ea79473d3cfc73bdcdc0dca5ec0 (patch)
treec97e688166331346c6a2ac24c66fa464a548e82c /app
parent84de687a7e7b750af24357c09ed3f7293ea8da28 (diff)
downloadgitlab-ce-a19c83dd7aa35ea79473d3cfc73bdcdc0dca5ec0.tar.gz
Consistently use Vue.nexTick when starting taskListdiscussion-perf-improvement
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes/stores/actions.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 9ecb2bc8f52..a4ab079d258 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -66,7 +66,7 @@ export const updateNote = ({ commit, dispatch }, { endpoint, note }) =>
.then(res => res.json())
.then(res => {
commit(types.UPDATE_NOTE, res);
- Vue.nextTick(() => dispatch('startTaskList'));
+ dispatch('startTaskList');
});
export const replyToDiscussion = ({ commit }, { endpoint, data }) =>
@@ -265,7 +265,7 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => {
}
});
- Vue.nextTick(() => dispatch('startTaskList'));
+ dispatch('startTaskList');
}
commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at);
@@ -375,12 +375,15 @@ export const setCommentsDisabled = ({ commit }, data) => {
};
export const startTaskList = ({ dispatch }) =>
- new TaskList({
- dataType: 'note',
- fieldName: 'note',
- selector: '.notes .is-editable',
- onSuccess: () => Vue.nextTick(() => dispatch('startTaskList')),
- });
+ Vue.nextTick(
+ () =>
+ new TaskList({
+ dataType: 'note',
+ fieldName: 'note',
+ selector: '.notes .is-editable',
+ onSuccess: () => dispatch('startTaskList'),
+ }),
+ );
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {};