From 1d4ce531fdf447cbe3a3e146816ee0f129e9823d Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Fri, 16 Feb 2024 18:03:52 +0200 Subject: [PATCH] Fix `initCompLabelEdit` not being called (#29198) Fix broken `if` from https://github.com/go-gitea/gitea/pull/29195 Signed-off-by: Yarden Shoham (cherry picked from commit 2d8756a9607ee6029ad7a44985e9751988d5fdaa) --- web_src/js/features/common-organization.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web_src/js/features/common-organization.js b/web_src/js/features/common-organization.js index a950af3adf..442714a3d6 100644 --- a/web_src/js/features/common-organization.js +++ b/web_src/js/features/common-organization.js @@ -6,9 +6,7 @@ export function initCommonOrganization() { return; } - const orgNameInput = document.querySelector('.organization.settings.options #org_name'); - if (!orgNameInput) return; - orgNameInput.addEventListener('input', function () { + document.querySelector('.organization.settings.options #org_name')?.addEventListener('input', function () { const nameChanged = this.value.toLowerCase() !== this.getAttribute('data-org-name').toLowerCase(); toggleElem('#org-name-change-prompt', nameChanged); });