mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-27 12:48:49 +01:00
fix(docs): guard before redirecting
This commit is contained in:
parent
413cbdbd01
commit
ec3ef4e879
5 changed files with 21 additions and 10 deletions
|
|
@ -11,6 +11,7 @@ import { NbThemeService } from '@nebular/theme';
|
|||
import { AnalyticsService } from './@core/utils/analytics.service';
|
||||
import { AbService } from './@core/utils/ab.service';
|
||||
import { SeoService } from './@core/utils/seo.service';
|
||||
import { CurrentThemeService } from './@core/utils/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-app',
|
||||
|
|
@ -24,7 +25,8 @@ export class AppComponent implements OnInit {
|
|||
private seoService: SeoService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private abService: AbService,
|
||||
private themeService: NbThemeService) {
|
||||
private themeService: NbThemeService,
|
||||
private currentThemeService: CurrentThemeService) {
|
||||
|
||||
this.themeService.onThemeChange()
|
||||
.subscribe((theme: any) => {
|
||||
|
|
@ -35,6 +37,8 @@ export class AppComponent implements OnInit {
|
|||
.subscribe((params: any) => {
|
||||
if (params.theme && this.themes.includes(params.theme)) {
|
||||
this.themeService.changeTheme(params.theme);
|
||||
} else {
|
||||
this.themeService.changeTheme(this.currentThemeService.getCurrentTheme());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue