Skip to content

Commit c48f5da

Browse files
committed
Tidy up comments
1 parent 268fef2 commit c48f5da

File tree

3 files changed

+7
-24
lines changed

3 files changed

+7
-24
lines changed

dotcom-rendering/.vscode/settings.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

dotcom-rendering/src/components/Masthead/HighlightsCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const HighlightsCard = ({
146146
headlineText={headlineText}
147147
dataLinkName={dataLinkName}
148148
isExternalLink={isExternalLink}
149-
trackCardClick={trackCardClick}
149+
trackCardClick={() => trackCardClick}
150150
/>
151151

152152
<div css={content}>

dotcom-rendering/src/components/ScrollableHighlights.importable.tsx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { isServer } from '../lib/isServer';
1212
import { ophanComponentId } from '../lib/ophan-helpers';
1313
import {
1414
getHighlightCards,
15-
getHighlightHistory,
1615
resetStoredHighlights,
1716
trackCardEngagement,
1817
} from '../lib/personalHighlights';
@@ -300,31 +299,20 @@ export const ScrollableHighlights = ({ trails, frontId }: Props) => {
300299
}, [orderedTrails]);
301300

302301
useEffect(() => {
303-
const ooo = getHighlightHistory();
304-
const orderedHighlights = getHighlightCards();
305-
console.log('>>> stored history', ooo);
306-
console.log('>>> ordered highlights', orderedHighlights);
307-
console.log('>>> trails', trails);
302+
const personalisedHighlights = getHighlightCards();
308303
if (
309-
orderedHighlights.length === 0 ||
310-
orderedHighlights.length !== trails.length ||
311-
!isEqual(orderedHighlights, trails)
304+
personalisedHighlights.length === 0 ||
305+
personalisedHighlights.length !== trails.length ||
306+
!isEqual(personalisedHighlights, trails)
312307
) {
313-
console.log(
314-
'>>> highlights are out of whack',
315-
orderedHighlights.length === 0,
316-
orderedHighlights.length !== trails.length,
317-
!isEqual(orderedHighlights, trails),
318-
);
319-
// store in local cache but dont bother setting in test trails as thats already set to trails
308+
// store in local cache but don't bother setting in test trails as they are already set to trails
320309
resetStoredHighlights(trails);
321310
// display highlights
322311
setShouldShowHighlights(true);
323312
return;
324313
}
325-
console.log('>>> highlights are good');
326314
// otherwise history is different to trails so set in state
327-
setOrderedTrails(orderedHighlights);
315+
setOrderedTrails(personalisedHighlights);
328316
}, [trails]);
329317

330318
const { ophanComponentLink, ophanComponentName, ophanFrontName } =

0 commit comments

Comments
 (0)