diff --git a/expo/src/Router.js b/expo/src/Router.js index a74099b46..d283ce972 100644 --- a/expo/src/Router.js +++ b/expo/src/Router.js @@ -280,7 +280,11 @@ const Router = () => { onReady={() => { API.navigation = navigationRef.current; if (alreadyExported) navigationRef.current.navigate("MODAL_EXPORT_DONE"); - else navigationRef.current.navigate("MODAL_CLOSE_APP"); + const lastShownEndModal = storage.getString("@lastShownEndModal"); + if (!lastShownEndModal || dayjsInstance().diff(lastShownEndModal, "day") >= 5) { + storage.set("@lastShownEndModal", dayjsInstance().format("YYYY-MM-DD")); + navigationRef.current.navigate("MODAL_CLOSE_APP"); + } }} onStateChange={onNavigationStateChange} linking={deepLinkingConfig} diff --git a/expo/src/scenes/WelcomeScreen/EndOzModal.js b/expo/src/scenes/WelcomeScreen/EndOzModal.js index 61db10fb7..2e9f8171f 100644 --- a/expo/src/scenes/WelcomeScreen/EndOzModal.js +++ b/expo/src/scenes/WelcomeScreen/EndOzModal.js @@ -12,15 +12,15 @@ const EndOzModal = ({ navigation }) => { const [currentPage, setCurrentPage] = useState(0); const pagerRef = useRef(null); - const onStartPress = async () => { - storage.set("@OnboardingDoneWithCGU", true); - navigation.navigate("USER_SURVEY_START", { from: "NEW_USER" }); - }; - const onPressNext = () => { if (pagerRef.current) { - pagerRef.current.setPage(currentPage + 1); - setCurrentPage(currentPage + 1); + if (currentPage === 3) { + navigation.goBack(); + } else { + pagerRef.current.setPage(currentPage + 1); + + setCurrentPage(currentPage + 1); + } } else { console.warn("Pager ref is not defined"); } @@ -40,7 +40,12 @@ const EndOzModal = ({ navigation }) => { - {}}> + { + navigation.goBack(); + }} + > { onPress={onPressNext} className="justify-center items-center flex-row rounded-3xl bg-[#DE285E] px-6 py-3" > - Suivant + + {currentPage === 3 ? "Terminer" : "Suivant"} +