summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-07-15 12:14:37 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-07-15 13:29:53 +0800
commitfcc7d5c016a75f975c1e66c6be708fc8e7a602c6 (patch)
tree9cc9a88ffe0790de0ffb9e2af86820d93ef07b28 /app
parent920fc2e3896de4a4a88689bead6c053029cebd1c (diff)
downloadgitlab-ce-fcc7d5c016a75f975c1e66c6be708fc8e7a602c6.tar.gz
Fix race condition with polling when saving notesfix-comment-race-condition
eTagPoll may not be initialized yet when we save a note. Polling is initialized only after discussions are loaded
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes/stores/actions.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 30eab272aa9..762a87ce0ff 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -357,11 +357,11 @@ export const poll = ({ commit, state, getters, dispatch }) => {
};
export const stopPolling = () => {
- eTagPoll.stop();
+ if (eTagPoll) eTagPoll.stop();
};
export const restartPolling = () => {
- eTagPoll.restart();
+ if (eTagPoll) eTagPoll.restart();
};
export const fetchData = ({ commit, state, getters }) => {