Skip to content

Commit

Permalink
fixed additional reloading on token renewal (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-aschlackman authored Jan 5, 2024
1 parent 0138620 commit baecd42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ComnAuthQuery, ComnAuthService, Theme } from '@cmusei/crucible-common';
import { User } from 'oidc-client-ts';
import { Observable, Subject } from 'rxjs';
import { map, takeUntil, tap } from 'rxjs/operators';
import { ApplicationData } from '../../../models/application-data';
Expand All @@ -28,7 +27,6 @@ import { FocusedAppService } from '../../../services/focused-app/focused-app.ser
})
export class ApplicationListComponent implements OnInit, OnChanges, OnDestroy {
@Input() viewId: string;
@Input() user: User;
@Input() teams: TeamData[];

public applications$: Observable<ApplicationData[]>;
Expand Down
8 changes: 4 additions & 4 deletions src/app/components/player/player.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ <h2>
</mat-list>
<app-application-list
[viewId]="data.view.id"
[user]="data.user"
[teams]="data.teams"
(toggleSideNavEvent)="sidenavToggleFn()"
></app-application-list>
Expand Down Expand Up @@ -62,11 +61,12 @@ <h2>
<app-focused-app></app-focused-app>

<app-notifications
*ngIf="user$ | async as user; else loading"
[viewGuid]="data.view.id"
[teamGuid]="data.team.id"
[userGuid]="data.user.profile.id"
[userToken]="data.user.access_token"
[userName]="data.user.profile.name"
[userGuid]="user.profile.id"
[userToken]="user.access_token"
[userName]="user.profile.name"
[topbarColor]="topbarColor"
class="notification-height"
>
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/player/player.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class PlayerComponent implements OnInit, OnDestroy {
public opened$: Observable<boolean> =
this.routerQuery.selectQueryParams('opened');

public user$ = this.loggedInUserService.loggedInUser$;

public view: View;
public viewId: string;
public opened: boolean;
Expand Down Expand Up @@ -92,7 +94,6 @@ export class PlayerComponent implements OnInit, OnDestroy {
// switchMap in case router state changes.
switchMap((state) =>
combineLatest([
this.loggedInUserService.loggedInUser$,
state.params['id']
? this.viewService.getView(state.params['id'])
: new Observable<View>(),
Expand All @@ -101,9 +102,8 @@ export class PlayerComponent implements OnInit, OnDestroy {
: new Observable<any>(),
]).pipe(
// this pipe allows us to return all previous observable values.
map(([user, view, teams]) => ({
map(([view, teams]) => ({
state,
user,
view,
teams: teams.filter((t) => t.isMember),
team: teams.find((t) => t.isPrimary),
Expand Down

0 comments on commit baecd42

Please sign in to comment.