From b534532eafd2fe5146cf470afb97d5b0842e2fa4 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 17 Nov 2023 11:37:04 +0100 Subject: [PATCH] [Glitch] Change to single opt-in during profile setup in onboarding in web UI Port 0e9801443f8f91ff49b47f82151ee5984c9bd6c1 to glitch-soc Signed-off-by: Claire --- .../glitch/features/onboarding/profile.jsx | 34 ++++++------- .../flavours/glitch/styles/forms.scss | 49 +++++++++++++++++-- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/app/javascript/flavours/glitch/features/onboarding/profile.jsx b/app/javascript/flavours/glitch/features/onboarding/profile.jsx index 571e746783..fd045009ab 100644 --- a/app/javascript/flavours/glitch/features/onboarding/profile.jsx +++ b/app/javascript/flavours/glitch/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 = () => {