summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/autosave.js5
-rw-r--r--app/assets/javascripts/notes/components/issue_notes_app.vue12
-rw-r--r--app/assets/javascripts/notes/stores/actions.js2
3 files changed, 8 insertions, 11 deletions
diff --git a/app/assets/javascripts/autosave.js b/app/assets/javascripts/autosave.js
index 6000c56665b..cfab6c40b34 100644
--- a/app/assets/javascripts/autosave.js
+++ b/app/assets/javascripts/autosave.js
@@ -2,11 +2,6 @@
import AccessorUtilities from './lib/utils/accessor';
window.Autosave = (function() {
- /**
- *
- * @param {*} field the textarea
- * @param {Array} key Array with: ['Note', type, id, ]
- */
function Autosave(field, key) {
this.field = field;
this.isLocalStorageAvailable = AccessorUtilities.isLocalStorageAccessSafe();
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) => {