Fix admin welcome modal show check

This commit is contained in:
Chocobozzz 2024-11-27 07:15:32 +01:00
parent 2214fedd8e
commit 488b89433f
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 9 additions and 5 deletions

View File

@ -79,6 +79,7 @@ export class AppComponent implements OnInit, AfterViewInit {
hotkeysModalOpened = false
private serverConfig: HTMLServerConfig
private userLoaded = false
constructor (
@Inject(DOCUMENT) private document: Document,
@ -267,7 +268,10 @@ export class AppComponent implements OnInit, AfterViewInit {
private listenUserChangeForModals () {
this.authService.userInformationLoaded
.pipe(map(() => this.authService.getUser()))
.subscribe(user => this.openModalsIfNeeded(user))
.subscribe(user => {
this.userLoaded = true
this.openModalsIfNeeded(user)
})
}
onModalCreated () {
@ -278,6 +282,8 @@ export class AppComponent implements OnInit, AfterViewInit {
}
private openModalsIfNeeded (user: User) {
if (!this.userLoaded) return
if (user.role.id === UserRole.ADMINISTRATOR) {
this.openAdminModalsIfNeeded(user)
} else {

View File

@ -57,7 +57,7 @@
overflow: hidden;
width: 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 {

View File

@ -4,7 +4,7 @@
.root {
width: 100%;
margin-bottom: 2rem;
@include rfs(2.5rem, margin-bottom);
}
h1 {
@ -98,8 +98,6 @@ h1 {
.children-container {
margin-top: 1.25rem;
@include rfs(margin-bottom, 2.5rem);
::ng-deep li {
white-space: nowrap;