From c6e5d616dece5a8190b626a280888d9c7c693382 Mon Sep 17 00:00:00 2001 From: Olivier Zalmanski <88216225+OlivierZal@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:26:37 +0200 Subject: [PATCH] simplify --- settings/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/settings/index.ts b/settings/index.ts index e8137853..dbc17090 100644 --- a/settings/index.ts +++ b/settings/index.ts @@ -186,13 +186,11 @@ const holidayModeEnabledElement = document.getElementById( const disableButton = (id: string, value = true): void => { const element = document.getElementById(id) - if (element) { if (value) { - element.classList.add('is-disabled') + element?.classList.add('is-disabled') return } - element.classList.remove('is-disabled') - } + element?.classList.remove('is-disabled') } const enableButton = (id: string, value = true): void => {