diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/assets/javascripts/diffs/utils/preferences.js | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) | |
download | gitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/assets/javascripts/diffs/utils/preferences.js')
-rw-r--r-- | app/assets/javascripts/diffs/utils/preferences.js | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/app/assets/javascripts/diffs/utils/preferences.js b/app/assets/javascripts/diffs/utils/preferences.js index e440de3350a..6b4aaf45937 100644 --- a/app/assets/javascripts/diffs/utils/preferences.js +++ b/app/assets/javascripts/diffs/utils/preferences.js @@ -1,22 +1,13 @@ import Cookies from 'js-cookie'; -import { getParameterValues } from '~/lib/utils/url_utility'; - import { DIFF_FILE_BY_FILE_COOKIE_NAME, DIFF_VIEW_FILE_BY_FILE } from '../constants'; export function fileByFile(pref = false) { - const search = getParameterValues(DIFF_FILE_BY_FILE_COOKIE_NAME)?.[0]; const cookie = Cookies.get(DIFF_FILE_BY_FILE_COOKIE_NAME); - let viewFileByFile = pref; // use the cookie first, if it exists if (cookie) { - viewFileByFile = cookie === DIFF_VIEW_FILE_BY_FILE; - } - - // the search parameter of the URL should override, if it exists - if (search) { - viewFileByFile = search === DIFF_VIEW_FILE_BY_FILE; + return cookie === DIFF_VIEW_FILE_BY_FILE; } - return viewFileByFile; + return pref; } |