Commit a19c83dd authored by Phil Hughes's avatar Phil Hughes

Consistently use Vue.nexTick when starting taskList

parent 84de687a
...@@ -66,7 +66,7 @@ export const updateNote = ({ commit, dispatch }, { endpoint, note }) => ...@@ -66,7 +66,7 @@ export const updateNote = ({ commit, dispatch }, { endpoint, note }) =>
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
commit(types.UPDATE_NOTE, res); commit(types.UPDATE_NOTE, res);
Vue.nextTick(() => dispatch('startTaskList')); dispatch('startTaskList');
}); });
export const replyToDiscussion = ({ commit }, { endpoint, data }) => export const replyToDiscussion = ({ commit }, { endpoint, data }) =>
...@@ -265,7 +265,7 @@ const pollSuccessCallBack = (resp, commit, state, getters, dispatch) => { ...@@ -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); commit(types.SET_LAST_FETCHED_AT, resp.last_fetched_at);
...@@ -375,12 +375,15 @@ export const setCommentsDisabled = ({ commit }, data) => { ...@@ -375,12 +375,15 @@ export const setCommentsDisabled = ({ commit }, data) => {
}; };
export const startTaskList = ({ dispatch }) => export const startTaskList = ({ dispatch }) =>
new TaskList({ Vue.nextTick(
dataType: 'note', () =>
fieldName: 'note', new TaskList({
selector: '.notes .is-editable', dataType: 'note',
onSuccess: () => Vue.nextTick(() => dispatch('startTaskList')), fieldName: 'note',
}); selector: '.notes .is-editable',
onSuccess: () => dispatch('startTaskList'),
}),
);
// prevent babel-plugin-rewire from generating an invalid default during karma tests // prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {}; export default () => {};
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