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.tsx26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx
index 61a08d49..1d639a41 100644
--- a/src/components/profile/Content.tsx
+++ b/src/components/profile/Content.tsx
@@ -98,10 +98,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);
@@ -145,7 +147,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));
};
/**
@@ -164,11 +166,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:
@@ -181,8 +188,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,
+ ]),
);
/**
@@ -391,7 +405,7 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
/>
),
)}
- {!userXId && profile.profile_completion_stage !== 1 && (
+ {!userXId && (
<TouchableOpacity
onPress={() =>
navigation.push('CategorySelection', {