summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-07-02 21:21:33 +0200
committerFatih Acet <acetfatih@gmail.com>2018-07-02 22:49:02 +0200
commite32c9afddae28e10c4e31724bcc7c8837b0a7b97 (patch)
tree6d75e9ed8440b45d230970ce69f6f27abd4f7b7f
parent00c1a58b096a8a03236442e6916d8b0a02d5919e (diff)
downloadgitlab-ce-_acet-diff-mode-reload-mr-page.tar.gz
Reload MR page when diff view mode changed._acet-diff-mode-reload-mr-page
This is a temp change. See #48666 for more details.
-rw-r--r--app/assets/javascripts/diffs/store/actions.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js
index 5e0fd5109bb..f3471e23e8b 100644
--- a/app/assets/javascripts/diffs/store/actions.js
+++ b/app/assets/javascripts/diffs/store/actions.js
@@ -30,19 +30,31 @@ export const fetchDiffFiles = ({ state, commit }) => {
};
export const setInlineDiffViewType = ({ commit }) => {
- commit(types.SET_DIFF_VIEW_TYPE, INLINE_DIFF_VIEW_TYPE);
-
Cookies.set(DIFF_VIEW_COOKIE_NAME, INLINE_DIFF_VIEW_TYPE);
const url = mergeUrlParams({ view: INLINE_DIFF_VIEW_TYPE }, window.location.href);
- historyPushState(url);
+
+ // This is a temporarily workaround for performance issues
+ if (process.env.NODE_ENV !== 'test') {
+ historyPushState(url);
+ commit(types.SET_DIFF_VIEW_TYPE, INLINE_DIFF_VIEW_TYPE);
+ }
+
+ // For some performance issues we reload the page. See #48666 for more details.
+ document.location.href = url;
};
export const setParallelDiffViewType = ({ commit }) => {
- commit(types.SET_DIFF_VIEW_TYPE, PARALLEL_DIFF_VIEW_TYPE);
-
Cookies.set(DIFF_VIEW_COOKIE_NAME, PARALLEL_DIFF_VIEW_TYPE);
const url = mergeUrlParams({ view: PARALLEL_DIFF_VIEW_TYPE }, window.location.href);
- historyPushState(url);
+
+ // This is a temporarily workaround for performance issues
+ if (process.env.NODE_ENV !== 'test') {
+ commit(types.SET_DIFF_VIEW_TYPE, PARALLEL_DIFF_VIEW_TYPE);
+ historyPushState(url);
+ }
+
+ // For some performance issues we reload the page. See #48666 for more details.
+ document.location.href = url;
};
export const showCommentForm = ({ commit }, params) => {