@@ -9,39 +9,37 @@ import { PlusIcon } from '../../styles/icons';
99import NavigationHeader from '../../components/NavigationHeader' ;
1010import Button from '../../components/Button' ;
1111import SafeAreaInsets from '../../components/SafeAreaInsets' ;
12- import { useProfile , useSelectedSlashtag } from '../../hooks/slashtags' ;
1312import ProfileCard from '../../components/ProfileCard' ;
1413import ProfileLinks from '../../components/ProfileLinks' ;
14+ import Divider from '../../components/Divider' ;
15+ import useKeyboard from '../../hooks/keyboard' ;
16+ import { useProfile , useSelectedSlashtag } from '../../hooks/slashtags' ;
1517import {
1618 setLinks ,
1719 setOnboardingProfileStep ,
1820} from '../../store/actions/slashtags' ;
19- import Store from '../../store/types ' ;
21+ import { removeTodo } from '../../store/actions/todos ' ;
2022import { BasicProfile } from '../../store/types/slashtags' ;
23+ import { slashtagsLinksSelector } from '../../store/reselect/slashtags' ;
24+ import { onboardingProfileStepSelector } from '../../store/reselect/slashtags' ;
25+ import { arraysMatch } from '../../utils/helpers' ;
2126import { saveProfile } from '../../utils/slashtags' ;
2227import type { RootStackScreenProps } from '../../navigation/types' ;
23- import { arraysMatch } from '../../utils/helpers' ;
24- import Divider from '../../components/Divider' ;
25- import { removeTodo } from '../../store/actions/todos' ;
26- import useKeyboard from '../../hooks/keyboard' ;
2728
2829export const ProfileEdit = ( {
2930 navigation,
3031} : RootStackScreenProps < 'Profile' | 'ProfileEdit' > ) : JSX . Element => {
3132 const { t } = useTranslation ( 'slashtags' ) ;
32- const [ fields , setFields ] = useState < Omit < BasicProfile , 'links' > > ( { } ) ;
33- const links = useSelector ( ( state : Store ) => state . slashtags . links ) ;
34- const [ hasEdited , setHasEdited ] = useState ( false ) ;
3533 const { keyboardShown } = useKeyboard ( ) ;
34+ const [ hasEdited , setHasEdited ] = useState ( false ) ;
35+ const [ fields , setFields ] = useState < Omit < BasicProfile , 'links' > > ( { } ) ;
36+ const links = useSelector ( slashtagsLinksSelector ) ;
37+ const onboardingStep = useSelector ( onboardingProfileStepSelector ) ;
3638
3739 const { url, slashtag } = useSelectedSlashtag ( ) ;
3840 const { profile : savedProfile } = useProfile ( url ) ;
3941
40- // TODO: after full backup, onboarding step should be set to DONE
41- // for now, we check if there is a savedProfile as a sign of onboarding done.
42- const onboardedProfile =
43- useSelector ( ( state : Store ) => state . slashtags . onboardingProfileStep ) ===
44- 'Done' || ! ! savedProfile ;
42+ const onboardedProfile = onboardingStep === 'Done' ;
4543
4644 const buttonContainerStyles = useMemo (
4745 ( ) => ( {
0 commit comments