@@ -12,7 +12,6 @@ import { isServer } from '../lib/isServer';
1212import { ophanComponentId } from '../lib/ophan-helpers' ;
1313import {
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