Skip to content

Commit c2ae3a1

Browse files
committed
refactor(Sidebar): onDestroy remove minimized classes
1 parent 9b8eb14 commit c2ae3a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

projects/coreui/angular/src/lib/sidebar/app-sidebar.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ export class AppSidebarComponent implements OnInit, OnDestroy {
5353
this.isCompact(this.compact);
5454
this.isFixed(this.fixed);
5555
this.isOffCanvas(this.offCanvas);
56+
this.sidebarService.toggle({ minimize: this.minimized } );
5657
this.subscriptionEvents = this.sidebarService.events$.subscribe(action => {
57-
if (action.minimize === 'toggle') {
58-
this.toggleMinimized();
58+
if (action.minimize !== undefined) {
59+
action.minimize === 'toggle' ? this.toggleMinimized() : this.minimized = !!action.minimize;
5960
}
6061
});
6162
}
@@ -64,6 +65,7 @@ export class AppSidebarComponent implements OnInit, OnDestroy {
6465
this.subscriptionEvents.unsubscribe();
6566
this.minimizedChange.complete();
6667
this.renderer.removeClass(this.document.body, 'sidebar-fixed');
68+
this._updateMinimized(false);
6769
}
6870

6971
isCompact(compact: boolean = this.compact): void {

0 commit comments

Comments
 (0)