From 0e9801443f8f91ff49b47f82151ee5984c9bd6c1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 17 Nov 2023 11:37:04 +0100 Subject: [PATCH] Change to single opt-in during profile setup in onboarding in web UI (#27876) --- .../mastodon/features/onboarding/profile.jsx | 34 ++++++------- app/javascript/mastodon/locales/en.json | 5 +- app/javascript/styles/mastodon/forms.scss | 49 +++++++++++++++++-- 3 files changed, 64 insertions(+), 24 deletions(-) diff --git a/app/javascript/mastodon/features/onboarding/profile.jsx b/app/javascript/mastodon/features/onboarding/profile.jsx index 19ba0bcb9..09e6b2c6c 100644 --- a/app/javascript/mastodon/features/onboarding/profile.jsx +++ b/app/javascript/mastodon/features/onboarding/profile.jsx @@ -5,8 +5,8 @@ import { useIntl, defineMessages, FormattedMessage } from 'react-intl'; import classNames from 'classnames'; import { useHistory } from 'react-router-dom'; -import { useDispatch } from 'react-redux'; +import { useDispatch } from 'react-redux'; import { ReactComponent as AddPhotoAlternateIcon } from '@material-symbols/svg-600/outlined/add_photo_alternate.svg'; import { ReactComponent as EditIcon } from '@material-symbols/svg-600/outlined/edit.svg'; @@ -33,7 +33,6 @@ export const Profile = () => { const [avatar, setAvatar] = useState(null); const [header, setHeader] = useState(null); const [discoverable, setDiscoverable] = useState(account.get('discoverable')); - const [indexable, setIndexable] = useState(account.get('indexable')); const [isSaving, setIsSaving] = useState(false); const [errors, setErrors] = useState(); const avatarFileRef = createRef(); @@ -54,10 +53,6 @@ export const Profile = () => { setDiscoverable(e.target.checked); }, [setDiscoverable]); - const handleIndexableChange = useCallback(e => { - setIndexable(e.target.checked); - }, [setIndexable]); - const handleAvatarChange = useCallback(e => { setAvatar(e.target?.files?.[0]); }, [setAvatar]); @@ -78,12 +73,12 @@ export const Profile = () => { avatar, header, discoverable, - indexable, + indexable: discoverable, })).then(() => history.push('/start/follows')).catch(err => { setIsSaving(false); setErrors(err.response.data.details); }); - }, [dispatch, displayName, note, avatar, header, discoverable, indexable, history]); + }, [dispatch, displayName, note, avatar, header, discoverable, history]); return ( <> @@ -141,18 +136,21 @@ export const Profile = () => {