Fix admin welcome modal show check
This commit is contained in:
parent
2214fedd8e
commit
488b89433f
|
@ -79,6 +79,7 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||||
hotkeysModalOpened = false
|
hotkeysModalOpened = false
|
||||||
|
|
||||||
private serverConfig: HTMLServerConfig
|
private serverConfig: HTMLServerConfig
|
||||||
|
private userLoaded = false
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
@Inject(DOCUMENT) private document: Document,
|
@Inject(DOCUMENT) private document: Document,
|
||||||
|
@ -267,7 +268,10 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||||
private listenUserChangeForModals () {
|
private listenUserChangeForModals () {
|
||||||
this.authService.userInformationLoaded
|
this.authService.userInformationLoaded
|
||||||
.pipe(map(() => this.authService.getUser()))
|
.pipe(map(() => this.authService.getUser()))
|
||||||
.subscribe(user => this.openModalsIfNeeded(user))
|
.subscribe(user => {
|
||||||
|
this.userLoaded = true
|
||||||
|
this.openModalsIfNeeded(user)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onModalCreated () {
|
onModalCreated () {
|
||||||
|
@ -278,6 +282,8 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private openModalsIfNeeded (user: User) {
|
private openModalsIfNeeded (user: User) {
|
||||||
|
if (!this.userLoaded) return
|
||||||
|
|
||||||
if (user.role.id === UserRole.ADMINISTRATOR) {
|
if (user.role.id === UserRole.ADMINISTRATOR) {
|
||||||
this.openAdminModalsIfNeeded(user)
|
this.openAdminModalsIfNeeded(user)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: calc(100% - 50px); // Space for links below the menu
|
max-height: calc(100% - 75px); // Space for links below the menu
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-menu-scrollbar {
|
.main-menu-scrollbar {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.root {
|
.root {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
margin-bottom: 2rem;
|
@include rfs(2.5rem, margin-bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
|
@ -98,8 +98,6 @@ h1 {
|
||||||
.children-container {
|
.children-container {
|
||||||
margin-top: 1.25rem;
|
margin-top: 1.25rem;
|
||||||
|
|
||||||
@include rfs(margin-bottom, 2.5rem);
|
|
||||||
|
|
||||||
::ng-deep li {
|
::ng-deep li {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue