Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix: reminder default
Browse files Browse the repository at this point in the history
  • Loading branch information
tangimds committed Mar 10, 2023
1 parent 27cf29a commit db2dfbc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/src/scenes/reminder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ const Reminder = ({ navigation, route }) => {
(async () => {
const existingReminder = await localStorage.getReminder();
if (existingReminder) setReminder(dayjs(existingReminder));
if (!existingReminder) {
setReminderRequest(DEFAULT_REMINDER);
}
if (inOnboarding)
await localStorage.setOnboardingStep(ONBOARDING_STEPS.STEP_REMINDER);
})();
}, []);

const handlePress = () => {
const submit = async () => {
const existingReminder = await localStorage.getReminder();
if (!existingReminder) {
setReminderRequest(DEFAULT_REMINDER);
}
navigation.navigate(
inOnboarding ? ONBOARDING_STEPS.STEP_EXPLANATION : "tabs"
);
Expand Down Expand Up @@ -100,7 +101,7 @@ const Reminder = ({ navigation, route }) => {
<StickyButtonContainer>
<Button
title={`Je valide`}
onPress={handlePress}
onPress={submit}
buttonStyle={{ minWidth: 0 }}
/>
</StickyButtonContainer>
Expand Down

0 comments on commit db2dfbc

Please sign in to comment.