Skip to content

Commit

Permalink
fix admin view search not loading data when opened in a new tab (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-aschlackman authored Apr 1, 2024
1 parent e8dd762 commit 9a6c80c
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { View, ViewService, ViewStatus } from '../../../generated/player-api';
import { DialogService } from '../../../services/dialog/dialog.service';
import { LoggedInUserService } from '../../../services/logged-in-user/logged-in-user.service';
import { AdminViewEditComponent } from './admin-view-edit/admin-view-edit.component';
import { filter, tap } from 'rxjs';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

export interface Action {
Value: string;
Expand Down Expand Up @@ -42,7 +44,15 @@ export class AdminViewSearchComponent implements OnInit {
public dialogService: DialogService,
public route: ActivatedRoute,
public router: Router
) {}
) {
this.loggedInUserService.isSuperUser$
.pipe(
filter((x) => x),
tap(() => this.refreshViews()),
takeUntilDestroyed()
)
.subscribe();
}

/**
* Initialization
Expand All @@ -58,10 +68,6 @@ export class AdminViewSearchComponent implements OnInit {
// Initial datasource
this.filterString = '';

if (this.loggedInUserService.isSuperUser$.getValue()) {
this.refreshViews();
}

// Check to see if a view was specified in the URL
const viewId = this.route.snapshot.queryParamMap.get('view');
if (viewId) {
Expand Down

0 comments on commit 9a6c80c

Please sign in to comment.