|
|
|
@ -8,6 +8,7 @@ import { GamePlan, PokemonFamilyEntry } from '../../core/models/plan.model'; |
|
|
|
import { PlanPokemonV2Component } from "./plan-pokemon/plan-pokemonV2.component"; |
|
|
|
import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; |
|
|
|
import { PlanPokemonDetailsComponent } from "./plan-pokemon-details/plan-pokemon-details.component"; |
|
|
|
import { AuthService } from '../../core/services/auth.service'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-planV2', |
|
|
|
@ -147,10 +148,19 @@ export class PlanV2Component implements OnInit { |
|
|
|
selectedGame: GamePlan | null = null; |
|
|
|
selectedPokemon: PokemonFamilyEntry | null = null; |
|
|
|
|
|
|
|
constructor(private planService: PlanService, private cdr: ChangeDetectorRef) {} |
|
|
|
constructor( |
|
|
|
private planService: PlanService, |
|
|
|
private cdr: ChangeDetectorRef, |
|
|
|
private authService: AuthService |
|
|
|
) {} |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
this.loadPlan(); |
|
|
|
this.authService.isAuthenticated$.subscribe((isAuthenticated) => { |
|
|
|
if (isAuthenticated) { |
|
|
|
this.loadPlan(); |
|
|
|
console.log("Loading Plan") |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private loadPlan() { |
|
|
|
|