Skip to content

Commit

Permalink
juice-shop#2149 Keep direct links to challenges stable for OpenCRE an…
Browse files Browse the repository at this point in the history
…d others
  • Loading branch information
bogminic committed Nov 23, 2023
1 parent c1dd927 commit 87be771
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/src/app/score-board/score-board.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ export class ScoreBoardComponent implements OnInit, OnDestroy {
this.subscriptions.push(dataLoaderSubscription)

const routerSubscription = this.route.queryParams.subscribe((queryParams) => {
// Fix to keep direct links to challenges stable for OpenCRE and others
if (queryParams.challenge && !queryParams.searchQuery) {
this.router.navigate([], {
queryParams: {
...queryParams,
challenge: null,
searchQuery: queryParams.challenge
}
})
return
}

this.filterSetting = fromQueryParams(queryParams)
this.filterAndUpdateChallenges()
})
Expand Down

0 comments on commit 87be771

Please sign in to comment.