mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-21 20:38:47 +00:00
feat(console): refresh roles, user-grants and project-members based on previous navigation (#728)
* feat: refresh roles, user-grants, project-members * refresh keys * user grants on granted projects * refresh on member changes * membership refresh * lint
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Event, NavigationEnd, Router } from '@angular/router';
|
||||
import { filter } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RefreshService {
|
||||
private fifo: Array<string> = ['', ''];
|
||||
constructor(router: Router) {
|
||||
router.events
|
||||
.pipe(filter(event => event instanceof NavigationEnd))
|
||||
.subscribe((event: Event | any) => {
|
||||
console.log('prev:', event.url);
|
||||
this.moveInto(event.url);
|
||||
});
|
||||
}
|
||||
|
||||
public get previousUrls(): Array<string> {
|
||||
return this.fifo;
|
||||
}
|
||||
|
||||
private moveInto(value: string): void {
|
||||
this.fifo[1] = this.fifo[0];
|
||||
this.fifo[0] = value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user