diff options
author | Simon Knox <psimyn@gmail.com> | 2018-04-02 06:18:00 +1000 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2018-04-02 06:19:46 +1000 |
commit | 7fb5ab31d94be5ef1f1f6f07e3890ee8df6baa81 (patch) | |
tree | 725c8cc3f82fa11f5f1cd2869d9fe49c65279551 /app/assets/javascripts/diffs/store/mutations.js | |
parent | db0256cb0fe7a99336c968d7e5b0624cf0534156 (diff) | |
download | gitlab-ce-vue_changes_comment_state.tar.gz |
trigger Vue change detectionvue_changes_comment_state
Diffstat (limited to 'app/assets/javascripts/diffs/store/mutations.js')
-rw-r--r-- | app/assets/javascripts/diffs/store/mutations.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/diffs/store/mutations.js b/app/assets/javascripts/diffs/store/mutations.js index d4b00c26ac2..f7f99b5d62a 100644 --- a/app/assets/javascripts/diffs/store/mutations.js +++ b/app/assets/javascripts/diffs/store/mutations.js @@ -1,3 +1,4 @@ +import Vue from 'vue'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import * as utils from './utils'; import * as types from './mutation_types'; @@ -48,19 +49,18 @@ export default { type: COMMENT_FORM_TYPE, }; - state.diffLineCommentForms[lineCode] = { - ...state.diffLineCommentForms[lineCode], - [linePosition]: { - formObj, - }, - }; + if (!state.diffLineCommentForms[lineCode]) { + Vue.set(state.diffLineCommentForms, lineCode, { linePosition: {} }); + } + + Vue.set(state.diffLineCommentForms[lineCode], linePosition, formObj); }, [types.REMOVE_COMMENT_FORM_LINE](state, { lineCode, linePosition }) { if (linePosition) { - delete state.diffLineCommentForms[lineCode][linePosition]; + Vue.set(state.diffLineCommentForms[lineCode], linePosition, null); } else { - delete state.diffLineCommentForms[lineCode]; + Vue.set(state.diffLineCommentForms, lineCode, null); } }, |