private route: ActivatedRoute,
private router: Router,
private auth: AuthService,
- private serverService: ServerService
+ private serverService: ServerService,
+ private redirectService: RedirectService
) {
super(data)
this.algorithmChangeSub = this.route.queryParams.subscribe(
queryParams => {
- const algorithm = queryParams['alg']
- if (algorithm) {
- this.data.model = algorithm
- } else {
- this.data.model = RedirectService.DEFAULT_TRENDING_ALGORITHM
- }
+ this.data.model = queryParams['alg'] || this.redirectService.getDefaultTrendingAlgorithm()
}
)
}
}
setSort () {
- const alg = this.data.model !== RedirectService.DEFAULT_TRENDING_ALGORITHM
+ const alg = this.data.model !== this.redirectService.getDefaultTrendingAlgorithm()
? this.data.model
: undefined