Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use localStorage value when reopening the menu and prevent that mobile screen size override the localStorage

Henriette Dinger0d6a6ad41dfa
diff --git a/frontend/src/app/components/main-menu/main-menu-toggle.service.ts b/frontend/src/app/components/main-menu/main-menu-toggle.service.ts
index afd40ec61d0..f9e4e11cdd3 100644
--- a/frontend/src/app/components/main-menu/main-menu-toggle.service.ts
+++ b/frontend/src/app/components/main-menu/main-menu-toggle.service.ts
@@ -98,7 +98,7 @@ export class MainMenuToggleService {
// On mobile the main menu shall close whenever you click outside the menu.
this.setupAutocloseMainMenu();
} else { // desktop version
- this.saveWidth(this.defaultWidth);
+ this.saveWidth(parseInt(window.OpenProject.guardedLocalStorage(this.localStorageKey) as string));
}
} else { // sidebar is expanded -> close menu
this.closeMenu();
@@ -115,11 +115,7 @@ export class MainMenuToggleService {
}
public closeMenu():void {
- if (this.deviceService.isMobile) {
- this.saveWidth(0);
- } else {
- this.setWidth(0);
- }
+ this.setWidth(0);
this.hideElements.addClass('hidden-navigation');
}