debian-mirror-gitlab/app/assets/javascripts/gitlab_version_check/utils.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
539 B
JavaScript
Raw Normal View History

2023-03-04 22:38:38 +05:30
import { setCookie, getCookie, parseBoolean } from '~/lib/utils/common_utils';
import { COOKIE_EXPIRATION, COOKIE_SUFFIX } from './constants';
const buildKey = (currentVersion) => {
return `${currentVersion}${COOKIE_SUFFIX}`;
};
export const setHideAlertModalCookie = (currentVersion) => {
const key = buildKey(currentVersion);
setCookie(key, true, { expires: COOKIE_EXPIRATION });
};
export const getHideAlertModalCookie = (currentVersion) => {
const key = buildKey(currentVersion);
return parseBoolean(getCookie(key));
};