Skip to content

Commit

Permalink
Fix WebHookEditor regression from jQuery removal
Browse files Browse the repository at this point in the history
Make these calls optional

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
  • Loading branch information
yardenshoham committed Mar 9, 2024
1 parent 7fdc048 commit 4af858f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web_src/js/features/comp/WebHookEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export function initCompWebHookEditor() {
}

const updateContentType = function () {
const visible = document.getElementById('http_method').value === 'POST';
toggleElem(document.getElementById('content_type').parentNode.parentNode, visible);
const visible = document.getElementById('http_method')?.value === 'POST';
toggleElem(document.getElementById('content_type')?.parentNode.parentNode, visible);
};
updateContentType();

document.getElementById('http_method').addEventListener('change', updateContentType);
document.getElementById('http_method')?.addEventListener('change', updateContentType);

// Test delivery
document.getElementById('test-delivery')?.addEventListener('click', async function () {
Expand Down

0 comments on commit 4af858f

Please sign in to comment.