Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Leo McArdle <[email protected]>
  • Loading branch information
caugner and LeoMcA authored Sep 23, 2024
1 parent 3f0fe62 commit ddeaf6d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ function LocaleRedirectSetting() {
const [value, setValue] = useState(false);

useEffect(() => {
setValue(!!getCookieValue(PREFERRED_LOCALE_COOKIE_NAME));
}, [setValue]);
setValue(Boolean(getCookieValue(PREFERRED_LOCALE_COOKIE_NAME)));
}, []);

function toggle(event) {
const newValue = event.target.checked;
Expand All @@ -147,7 +147,7 @@ function LocaleRedirectSetting() {
} else {
deleteCookie(PREFERRED_LOCALE_COOKIE_NAME);
}
setValue(event.target.checked);
setValue(newValue);
gleanClick(`${LANGUAGE_REDIRECT}: ${locale} -> ${Number(newValue)}`);
}

Expand Down

0 comments on commit ddeaf6d

Please sign in to comment.