summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes/stores
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/notes/stores')
-rw-r--r--app/assets/javascripts/notes/stores/actions.js13
-rw-r--r--app/assets/javascripts/notes/stores/getters.js5
2 files changed, 6 insertions, 12 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 1204d68159f..bdb85360be8 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -345,7 +345,7 @@ export const saveNote = ({ commit, dispatch }, noteData) => {
// this is a temporary solution until we have confidentiality real-time updates
if (
confidentialWidget.setConfidentiality &&
- message.some((m) => m.includes('confidential'))
+ message.some((m) => m.includes('Made this issue confidential'))
) {
confidentialWidget.setConfidentiality();
}
@@ -468,15 +468,6 @@ const getFetchDataParams = (state) => {
return { endpoint, options };
};
-export const fetchData = ({ commit, state, getters, dispatch }) => {
- const { endpoint, options } = getFetchDataParams(state);
-
- axios
- .get(endpoint, options)
- .then(({ data }) => pollSuccessCallBack(data, commit, state, getters, dispatch))
- .catch(() => Flash(__('Something went wrong while fetching latest comments.')));
-};
-
export const poll = ({ commit, state, getters, dispatch }) => {
eTagPoll = new Poll({
resource: {
@@ -493,7 +484,7 @@ export const poll = ({ commit, state, getters, dispatch }) => {
if (!Visibility.hidden()) {
eTagPoll.makeDelayedRequest(2500);
} else {
- dispatch('fetchData');
+ eTagPoll.makeRequest();
}
Visibility.change(() => {
diff --git a/app/assets/javascripts/notes/stores/getters.js b/app/assets/javascripts/notes/stores/getters.js
index 39f66063cfb..b04b1d28ffa 100644
--- a/app/assets/javascripts/notes/stores/getters.js
+++ b/app/assets/javascripts/notes/stores/getters.js
@@ -1,4 +1,6 @@
import { flattenDeep, clone } from 'lodash';
+import { statusBoxState } from '~/issuable/components/status_box.vue';
+import { isInMRPage } from '~/lib/utils/common_utils';
import * as constants from '../constants';
import { collapseSystemNotes } from './collapse_utils';
@@ -82,7 +84,8 @@ export const getBlockedByIssues = (state) => state.noteableData.blocked_by_issue
export const userCanReply = (state) => Boolean(state.noteableData.current_user.can_create_note);
-export const openState = (state) => state.noteableData.state;
+export const openState = (state) =>
+ isInMRPage() ? statusBoxState.state : state.noteableData.state;
export const getUserData = (state) => state.userData || {};