diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-08-07 20:23:56 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-08-07 20:23:56 +0300 |
commit | 25fcee16f5e1640b88bfc893cabdddbed5bc2551 (patch) | |
tree | 041cdd8b469f1d57fa19ecebe062386b01b23bda /app/assets/javascripts/notes | |
parent | fecb1a2f3c77205a72eeff1a3501629d2d1811d8 (diff) |
Init adding tests
Diffstat (limited to 'app/assets/javascripts/notes')
-rw-r--r-- | app/assets/javascripts/notes/components/issue_notes_app.vue | 12 | ||||
-rw-r--r-- | app/assets/javascripts/notes/stores/actions.js | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/app/assets/javascripts/notes/components/issue_notes_app.vue b/app/assets/javascripts/notes/components/issue_notes_app.vue index 4c0351f701b..371addd937e 100644 --- a/app/assets/javascripts/notes/components/issue_notes_app.vue +++ b/app/assets/javascripts/notes/components/issue_notes_app.vue @@ -114,10 +114,12 @@ this.fetchNotes(); this.initPolling(); - this.$el.parentElement.addEventListener('toggleAward', (event) => { - const { awardName, noteId } = event.detail; - this.actionToggleAward({ awardName, noteId }); - }); + if (this.$el.parentElement) { + this.$el.parentElement.addEventListener('toggleAward', (event) => { + const { awardName, noteId } = event.detail; + this.actionToggleAward({ awardName, noteId }); + }); + } }, }; </script> @@ -126,7 +128,7 @@ <div id="notes"> <div v-if="isLoading" - class="loading"> + class="js-loading loading"> <loading-icon /> </div> diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index 0c9eb046298..1ad7648e533 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -134,7 +134,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => { }; const pollSuccessCallBack = (resp, commit, state, getters) => { - if (resp.notes.length) { + if (resp.notes && resp.notes.length) { const { notesById } = getters; resp.notes.forEach((note) => { |