Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Load static configuration once user logs in
Browse files Browse the repository at this point in the history
  • Loading branch information
Reed Martz committed Apr 5, 2018
1 parent a9bd742 commit 7daf18f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/angular/planit/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,17 @@ import { ResetPasswordComponent } from './reset-password/reset-password.componen
bootstrap: [AppComponent]
})
export class AppModule {
constructor (private datasetService: DatasetService,
constructor (private userService: UserService,
private datasetService: DatasetService,
private scenarioService: ScenarioService,
private modelService: ClimateModelService) {
// Issue a eager request for indicator static configuration data so it's already cached if
// the user opens an indicator chart
this.datasetService.list().subscribe();
this.scenarioService.list().subscribe();
this.modelService.list().subscribe();
this.userService.currentUser.first().subscribe(() => {
// Issue a eager request for indicator static configuration data so it's already cached if
// the user opens an indicator chart
this.datasetService.list().subscribe();
this.scenarioService.list().subscribe();
this.modelService.list().subscribe();
});

}
}

0 comments on commit 7daf18f

Please sign in to comment.