aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Content.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r--src/components/profile/Content.tsx28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx
index 9213e012..e7fb566b 100644
--- a/src/components/profile/Content.tsx
+++ b/src/components/profile/Content.tsx
@@ -107,10 +107,12 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
const [shouldBounce, setShouldBounce] = useState<boolean>(true);
const [refreshing, setRefreshing] = useState<boolean>(false);
- //These two booleans are used to see if user closed the pormpt displayed to them
const [isStageTwoPromptClosed, setIsStageTwoPromptClosed] = useState<boolean>(
false,
);
+ const [isStageOnePromptClosed, setIsStageOnePromptClosed] = useState<boolean>(
+ false,
+ );
const [isStageThreePromptClosed, setIsStageThreePromptClosed] = useState<
boolean
>(false);
@@ -154,7 +156,7 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
const move = (direction: 'up' | 'down', title: string) => {
let categories = [...momentCategories];
categories = moveCategory(categories, title, direction === 'up');
- dispatch(updateMomentCategories(categories));
+ dispatch(updateMomentCategories(categories, false));
};
/**
@@ -173,11 +175,16 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
const navigateToMomentUploadPrompt = () => {
switch (profile.profile_completion_stage) {
case 1:
- if (momentCategories && momentCategories[0]) {
+ if (
+ momentCategories &&
+ momentCategories[0] &&
+ !isStageOnePromptClosed
+ ) {
navigation.navigate('MomentUploadPrompt', {
screenType,
momentCategory: momentCategories[0],
});
+ setIsStageOnePromptClosed(true);
}
break;
case 2:
@@ -190,8 +197,15 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
break;
}
};
- setTimeout(navigateToMomentUploadPrompt, 2000);
- }, [profile.profile_completion_stage, momentCategories]),
+ if (!userXId) {
+ setTimeout(navigateToMomentUploadPrompt, 2000);
+ }
+ }, [
+ profile.profile_completion_stage,
+ momentCategories,
+ userXId,
+ isStageOnePromptClosed,
+ ]),
);
useEffect(() => {
@@ -270,7 +284,7 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
momentCategories.filter((mc) => mc !== category),
false,
),
- );
+ )
dispatch(deleteUserMomentsForCategory(category));
},
},
@@ -379,7 +393,7 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
/>
),
)}
- {!userXId && profile.profile_completion_stage !== 1 && (
+ {!userXId && (
<TouchableOpacity
onPress={() =>
navigation.push('CategorySelection', {