Extended release version cookie expiry till a month (#526)

This commit is contained in:
darth-coder00 2021-09-19 23:54:24 +05:30 committed by GitHub
parent cda1613a6f
commit 27f91a2b90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,3 @@
export const getReleaseVersionExpiry = () => {
return new Date(Date.now() + 60 * 60 * 24 * 31 * 1000);
};

View File

@ -21,6 +21,7 @@ import React, { FunctionComponent, useState } from 'react';
import ChangeLogs from './ChangeLogs';
import FeaturesCarousel from './FeaturesCarousel';
import { COOKIE_VERSION, LATEST_VERSION_ID, WHATS_NEW } from './whatsNewData';
import { getReleaseVersionExpiry } from './WhatsNewModal.util';
// import { Button } from '../../buttons/Button/Button';
type Props = {
@ -56,7 +57,9 @@ export const WhatsNewModal: FunctionComponent<Props> = ({
};
const handleCancel = () => {
cookieStorage.setItem(COOKIE_VERSION, 'true');
cookieStorage.setItem(COOKIE_VERSION, 'true', {
expires: getReleaseVersionExpiry(),
});
onCancel();
};