Welcome to mirror list, hosted at ThFree Co, Russian Federation.

preferences.js « utils « diffs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6b4aaf45937dc5f6c8d3bb986b20dc3789ebf8a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import Cookies from 'js-cookie';
import { DIFF_FILE_BY_FILE_COOKIE_NAME, DIFF_VIEW_FILE_BY_FILE } from '../constants';

export function fileByFile(pref = false) {
  const cookie = Cookies.get(DIFF_FILE_BY_FILE_COOKIE_NAME);

  // use the cookie first, if it exists
  if (cookie) {
    return cookie === DIFF_VIEW_FILE_BY_FILE;
  }

  return pref;
}