93492: Fix SSR dodging pinned admin sidebar

On the server, @slideSidebarPadding always resolved to 'expanded' because slideSidebarOver did not emit true
This resulted in the SSR HTML leaving space for the expanded sidebar.

Also got rid of the sliding animation as it would always play, even when replacing SSR HTML where the sidebar was already visible.
This commit is contained in:
Yura Bondarenko
2022-08-05 12:23:03 +02:00
parent a77b1da804
commit c5d3776df7
4 changed files with 10 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
import { map } from 'rxjs/operators';
import { map, startWith } from 'rxjs/operators';
import { Component, Inject, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@@ -71,7 +71,8 @@ export class RootComponent implements OnInit {
const sidebarCollapsed = this.menuService.isMenuCollapsed(MenuID.ADMIN);
this.slideSidebarOver = combineLatestObservable([sidebarCollapsed, this.windowService.isXsOrSm()])
.pipe(
map(([collapsed, mobile]) => collapsed || mobile)
map(([collapsed, mobile]) => collapsed || mobile),
startWith(true),
);
if (this.router.url === getPageInternalServerErrorRoute()) {