diff --git a/app/javascript/packs/admin.tsx b/app/javascript/packs/admin.tsx index 25e0889cd99..9fee5605659 100644 --- a/app/javascript/packs/admin.tsx +++ b/app/javascript/packs/admin.tsx @@ -149,7 +149,7 @@ Rails.delegate( }, ); -const onDomainBlockSeverityChange = (target: HTMLInputElement) => { +const onDomainBlockSeverityChange = (target: HTMLSelectElement) => { const rejectMediaDiv = document.querySelector( '.input.with_label.domain_block_reject_media', ); @@ -169,7 +169,7 @@ const onDomainBlockSeverityChange = (target: HTMLInputElement) => { }; Rails.delegate(document, '#domain_block_severity', 'change', ({ target }) => { - if (target instanceof HTMLInputElement) onDomainBlockSeverityChange(target); + if (target instanceof HTMLSelectElement) onDomainBlockSeverityChange(target); }); const onEnableBootstrapTimelineAccountsChange = (target: HTMLInputElement) => { @@ -206,7 +206,7 @@ Rails.delegate( }, ); -const onChangeRegistrationMode = (target: HTMLInputElement) => { +const onChangeRegistrationMode = (target: HTMLSelectElement) => { const enabled = target.value === 'approved'; document @@ -256,7 +256,7 @@ Rails.delegate( '#form_admin_settings_registrations_mode', 'change', ({ target }) => { - if (target instanceof HTMLInputElement) onChangeRegistrationMode(target); + if (target instanceof HTMLSelectElement) onChangeRegistrationMode(target); }, ); @@ -286,11 +286,11 @@ async function mountReactComponent(element: Element) { } ready(() => { - const domainBlockSeverityInput = document.querySelector( - 'input#domain_block_severity', + const domainBlockSeveritySelect = document.querySelector( + 'select#domain_block_severity', ); - if (domainBlockSeverityInput) - onDomainBlockSeverityChange(domainBlockSeverityInput); + if (domainBlockSeveritySelect) + onDomainBlockSeverityChange(domainBlockSeveritySelect); const enableBootstrapTimelineAccounts = document.querySelector( @@ -299,8 +299,8 @@ ready(() => { if (enableBootstrapTimelineAccounts) onEnableBootstrapTimelineAccountsChange(enableBootstrapTimelineAccounts); - const registrationMode = document.querySelector( - 'input#form_admin_settings_registrations_mode', + const registrationMode = document.querySelector( + 'select#form_admin_settings_registrations_mode', ); if (registrationMode) onChangeRegistrationMode(registrationMode);