Skip to content

Commit 903f164

Browse files
committed
fix(profile): remove temp onboarding skip
1 parent d879231 commit 903f164

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

src/screens/Profile/Profile.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,8 @@ import { ProfileIntro, OfflinePayments } from './ProfileOnboarding';
4848
import type { RootStackScreenProps } from '../../navigation/types';
4949

5050
const Profile = memo((props: RootStackScreenProps<'Profile'>): ReactElement => {
51-
const { url } = useSelectedSlashtag();
52-
const { profile } = useProfile(url);
5351
const onboardingProfileStep = useSelector(onboardingProfileStepSelector);
5452

55-
// TEMP: remove after full backups are working
56-
// skip onboarding if we have a profile already
57-
if (profile.name) {
58-
return <ProfileScreen {...props} />;
59-
}
60-
6153
switch (onboardingProfileStep) {
6254
case 'Intro':
6355
return <ProfileIntro {...props} />;

src/screens/Profile/ProfileEdit.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,37 @@ import { PlusIcon } from '../../styles/icons';
99
import NavigationHeader from '../../components/NavigationHeader';
1010
import Button from '../../components/Button';
1111
import SafeAreaInsets from '../../components/SafeAreaInsets';
12-
import { useProfile, useSelectedSlashtag } from '../../hooks/slashtags';
1312
import ProfileCard from '../../components/ProfileCard';
1413
import ProfileLinks from '../../components/ProfileLinks';
14+
import Divider from '../../components/Divider';
15+
import useKeyboard from '../../hooks/keyboard';
16+
import { useProfile, useSelectedSlashtag } from '../../hooks/slashtags';
1517
import {
1618
setLinks,
1719
setOnboardingProfileStep,
1820
} from '../../store/actions/slashtags';
19-
import Store from '../../store/types';
21+
import { removeTodo } from '../../store/actions/todos';
2022
import { 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';
2126
import { saveProfile } from '../../utils/slashtags';
2227
import 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

2829
export 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

Comments
 (0)