diff options
Diffstat (limited to 'client/src/app/core/routing/trending-guard.service.ts')
-rw-r--r-- | client/src/app/core/routing/trending-guard.service.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/app/core/routing/trending-guard.service.ts b/client/src/app/core/routing/trending-guard.service.ts new file mode 100644 index 000000000..7db7fe994 --- /dev/null +++ b/client/src/app/core/routing/trending-guard.service.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot } from '@angular/router' | ||
3 | import { RedirectService } from './redirect.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class TrendingGuard implements CanActivate { | ||
7 | |||
8 | constructor (private redirectService: RedirectService) {} | ||
9 | |||
10 | canActivate (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { | ||
11 | this.redirectService.redirectToTrending() | ||
12 | return false | ||
13 | } | ||
14 | } | ||