Skip to content

Commit

Permalink
DON-925: Don't leave homepage in browser history when redirecting to …
Browse files Browse the repository at this point in the history
…CC23
  • Loading branch information
bdsl committed Nov 20, 2023
1 parent d93e809 commit abd07ea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,21 @@ export class HomeComponent implements OnInit {
}

// start the redirect 12 hours in advance of CC open:
const startRedirectingToCCAt = new Date('2023-11-28T00:00:00+00:00');
const startRedirectingToCCAt = new Date('2023-10-28T00:00:00+00:00');

// end the redirect exactly at the time CC closes.
if (
!queryParams.hasOwnProperty('noredirect') &&
this.currentTime >= startRedirectingToCCAt &&
this.currentTime < CCCloseDate &&
isPlatformBrowser(this.platformId)) {
this.router.navigate(['/christmas-challenge-2023']);
this.router.navigate(
['/christmas-challenge-2023'],
{
replaceUrl: true, // As we are redirecting imediatly it would be confusing to leave a page the user hasn't seen in their history.

}
);
}
}

Expand Down

0 comments on commit abd07ea

Please sign in to comment.