rm save interests function

This commit is contained in:
Samuel Newman
2025-08-26 12:22:21 +01:00
parent 3ab936b85b
commit 5dc0506e0d
@@ -25,7 +25,6 @@ import {useSuggestedUsers} from '#/screens/Search/util/useSuggestedUsers'
import {atoms as a, tokens, useBreakpoints, useTheme} from '#/alf' import {atoms as a, tokens, useBreakpoints, useTheme} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as ArrowRotateCounterClockwiseIcon} from '#/components/icons/ArrowRotateCounterClockwise' import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as ArrowRotateCounterClockwiseIcon} from '#/components/icons/ArrowRotateCounterClockwise'
import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRightIcon} from '#/components/icons/Chevron'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import * as ProfileCard from '#/components/ProfileCard' import * as ProfileCard from '#/components/ProfileCard'
import {boostInterests} from '#/components/ProgressGuide/FollowDialog' import {boostInterests} from '#/components/ProgressGuide/FollowDialog'
@@ -44,7 +43,6 @@ export function StepSuggestedAccounts() {
const queryClient = useQueryClient() const queryClient = useQueryClient()
const {state, dispatch} = useContext(Context) const {state, dispatch} = useContext(Context)
const [saving, setSaving] = useState(false)
const onboardDispatch = useOnboardingDispatch() const onboardDispatch = useOnboardingDispatch()
const [selectedInterest, setSelectedInterest] = useState<string | null>(null) const [selectedInterest, setSelectedInterest] = useState<string | null>(null)
@@ -79,18 +77,6 @@ export function StepSuggestedAccounts() {
const isError = !!error const isError = !!error
const saveInterests = useCallback(async () => {
setSaving(true)
try {
setSaving(false)
dispatch({type: 'next'})
} catch (e: any) {
logger.info(`onboading: error saving interests`)
logger.error(e)
}
}, [setSaving, dispatch])
const skipOnboarding = useCallback(() => { const skipOnboarding = useCallback(() => {
onboardDispatch({type: 'finish'}) onboardDispatch({type: 'finish'})
dispatch({type: 'finish'}) dispatch({type: 'finish'})
@@ -239,7 +225,7 @@ export function StepSuggestedAccounts() {
) : ( ) : (
<View style={[a.gap_md, gtMobile ? a.flex_row : a.flex_col]}> <View style={[a.gap_md, gtMobile ? a.flex_row : a.flex_col]}>
<Button <Button
disabled={saving || !canFollowAll} disabled={!canFollowAll}
color="secondary" color="secondary"
size="large" size="large"
label={_(msg`Follow all accounts`)} label={_(msg`Follow all accounts`)}
@@ -250,15 +236,14 @@ export function StepSuggestedAccounts() {
{isFollowingAll && <ButtonIcon icon={Loader} />} {isFollowingAll && <ButtonIcon icon={Loader} />}
</Button> </Button>
<Button <Button
disabled={saving} disabled={isFollowingAll}
color="primary" color="primary"
size="large" size="large"
label={_(msg`Continue to next step`)} label={_(msg`Continue to next step`)}
onPress={saveInterests}> onPress={() => dispatch({type: 'next'})}>
<ButtonText> <ButtonText>
<Trans>Continue</Trans> <Trans>Continue</Trans>
</ButtonText> </ButtonText>
<ButtonIcon icon={saving ? Loader : ChevronRightIcon} />
</Button> </Button>
</View> </View>
)} )}