Fix linter warnings

Change-Id: I012a98cb3fcbfaa2ba40d85c0225bcf44deb5c01
This commit is contained in:
bwang 2024-09-26 14:24:25 -05:00
parent 15e7bf48d1
commit dd570d7912
2 changed files with 15 additions and 5 deletions

View file

@ -233,7 +233,9 @@ function makeFeedbackLink( betaMessageElement ) {
* @param {Record<string,ClientPreference>} config
* @param {UserPreferencesApi} userPreferences
*/
function appendToggleSwitch( form, featureName, labelElement, currentValue, config, userPreferences ) {
function appendToggleSwitch(
form, featureName, labelElement, currentValue, config, userPreferences
) {
const input = makeInputElement( 'checkbox', featureName, currentValue );
input.classList.add( 'cdx-toggle-switch__input' );
const switcher = document.createElement( 'span' );
@ -300,13 +302,17 @@ function makeControl( featureName, config, userPreferences ) {
switch ( type ) {
case 'radio':
pref.options.forEach( ( value ) => {
appendRadioToggle( form, featureName, value, String( currentValue ), config, userPreferences );
appendRadioToggle(
form, featureName, value, String( currentValue ), config, userPreferences
);
} );
break;
case 'switch': {
const labelElement = document.createElement( 'label' );
labelElement.textContent = getFeatureLabelMsg( featureName ).text();
appendToggleSwitch( form, featureName, labelElement, String( currentValue ), config, userPreferences );
appendToggleSwitch(
form, featureName, labelElement, String( currentValue ), config, userPreferences
);
break;
} default:
throw new Error( 'Unknown client preference! Only switch or radio are supported.' );

View file

@ -91,11 +91,15 @@ function main( window ) {
// disable our night mode if so
if ( isNightModeGadgetEnabled() ) {
disableNightModeForGadget();
clientPreferences.render( appearanceMenuSelector, clientPreferenceConfig, userPreferences );
clientPreferences.render(
appearanceMenuSelector, clientPreferenceConfig, userPreferences
);
alterExclusionMessage();
removeBetaNotice();
} else {
clientPreferences.render( appearanceMenuSelector, clientPreferenceConfig, userPreferences );
clientPreferences.render(
appearanceMenuSelector, clientPreferenceConfig, userPreferences
);
}
} );
}