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

simplify event listener

Behrokh Satarnejad904482bfd065
diff --git a/frontend/src/app/core/setup/globals/global-listeners.ts b/frontend/src/app/core/setup/globals/global-listeners.ts
index 2be75223fa5..b043cd4091b 100644
--- a/frontend/src/app/core/setup/globals/global-listeners.ts
+++ b/frontend/src/app/core/setup/globals/global-listeners.ts
@@ -87,12 +87,8 @@ export function initializeGlobalListeners():void {
// Listen for 'zenModeToggled' event to toggle Zen Mode styling on the body.
// Adds 'zen-mode' class if active; removes it if not.
window.addEventListener('zenModeToggled', (event:CustomEvent) => {
- const isActive = event.detail.active;
- if (isActive) {
- document.body.classList.add('zen-mode');
- } else {
- document.body.classList.remove('zen-mode');
- }
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-argument
+ document.body.classList.toggle('zen-mode', event.detail.active);
});
// Jump to the element given by location.hash, if present