Skip to content

Commit

Permalink
We don't need recurring contributor cookie either
Browse files Browse the repository at this point in the history
  • Loading branch information
rupertbates committed Dec 19, 2024
1 parent ed87b45 commit 2ccdae1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
4 changes: 2 additions & 2 deletions dotcom-rendering/src/lib/contributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import type { DCRFrontType } from '../types/front';
import type { DCRNewslettersPageType } from '../types/newslettersPage';
import type { DCRTagPageType } from '../types/tagPage';

// User Attributes API cookies (created on sign-in)
// User Attributes API cookie (created on sign-in)
export const HIDE_SUPPORT_MESSAGING_COOKIE = 'gu_hide_support_messaging';
export const RECURRING_CONTRIBUTOR_COOKIE = 'gu_recurring_contributor';

export const OPT_OUT_OF_ARTICLE_COUNT_COOKIE = 'gu_article_count_opt_out';

// Local storage keys
Expand Down
22 changes: 2 additions & 20 deletions dotcom-rendering/src/lib/readerRevenueDevUtils.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import { getCookie, removeCookie, setCookie, storage } from '@guardian/libs';
import {
HIDE_SUPPORT_MESSAGING_COOKIE,
RECURRING_CONTRIBUTOR_COOKIE,
SUPPORT_ONE_OFF_CONTRIBUTION_COOKIE,
} from './contributions';
import { HIDE_SUPPORT_MESSAGING_COOKIE } from './contributions';
import { getLocaleCode } from './getCountryCode';

const readerRevenueCookies = [
HIDE_SUPPORT_MESSAGING_COOKIE,
RECURRING_CONTRIBUTOR_COOKIE,
SUPPORT_ONE_OFF_CONTRIBUTION_COOKIE,
];
const readerRevenueCookies = [HIDE_SUPPORT_MESSAGING_COOKIE];

const clearEpicViewLog = (): void =>
storage.local.remove('gu.contributions.views');
Expand All @@ -22,12 +14,6 @@ const clearBannerLastClosedAt = (): void => {
storage.local.remove('gu.noRRBannerTimestamp');
};

const fakeOneOffContributor = (): void =>
setCookie({
name: SUPPORT_ONE_OFF_CONTRIBUTION_COOKIE,
value: Date.now().toString(),
});

const MULTIVARIATE_ID_COOKIE = 'GU_mvt_id';
const MAX_CLIENT_MVT_ID = 1000000;
const incrementMvtCookie = (): void => {
Expand Down Expand Up @@ -76,10 +62,6 @@ const clearCommonReaderRevenueStateAndReload = (
for (const cookie of readerRevenueCookies) removeCookie({ name: cookie });
clearEpicViewLog();

if (asExistingSupporter) {
fakeOneOffContributor();
}

window.location.reload();
};

Expand Down

0 comments on commit 2ccdae1

Please sign in to comment.