Skip to content

Commit aef796d

Browse files
committed
fix: dont throw error on data deletion
1 parent 9726e16 commit aef796d

5 files changed

Lines changed: 20 additions & 3 deletions

File tree

app.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@
136136
}
137137
]
138138
}
139+
],
140+
[
141+
"expo-splash-screen",
142+
{
143+
"backgroundColor": "#ffffff",
144+
"image": "./src/assets/ios/default.png",
145+
"dark": {
146+
"image": "./src/assets/ios/dark.png",
147+
"backgroundColor": "#232323"
148+
},
149+
"imageWidth": 200
150+
}
139151
]
140152
],
141153
"experiments": {

eas.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cli": {
3-
"version": ">= 5.6.0"
3+
"version": ">= 12.0.0",
4+
"appVersionSource": "remote"
45
},
56
"build": {
67
"development": {
@@ -23,6 +24,7 @@
2324
}
2425
},
2526
"production": {
27+
"autoIncrement": true,
2628
"ios": {
2729
"resourceClass": "m-medium",
2830
"image": "latest"

src/app/settings.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,10 @@ export default function ShowSettingsScreen() {
176176
onPress={() =>
177177
clearAllData().then(() => {
178178
haptics('success');
179-
throw new Error('Data deletion forced');
180179
})
181180
}
182181
>
183-
Forcer la suppression de données
182+
Supprimer mes données de l'application
184183
</Button>
185184

186185
{IS_BETA && (

src/assets/ent/univ.png

23.1 KB
Loading

src/context/AppContext.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { File, Paths } from 'expo-file-system';
44
import AsyncStorage from '@react-native-async-storage/async-storage';
55
import type { CalendarEvent } from '../types';
66
import { setHapticsEnabled } from '../utils/haptics';
7+
import { router } from 'expo-router';
78

89
interface AppContextValue {
910
adeid: string | null;
@@ -65,14 +66,17 @@ export function AppProvider({ children }: { children: React.ReactNode }) {
6566
]);
6667

6768
const calFile = new File(Paths.document, 'calendar.json');
69+
if (calFile.exists) {
6870
calFile.delete();
71+
}
6972

7073
await AsyncStorage.clear();
7174

7275
setAdeid(null);
7376
setHapticsOn(true);
7477
setCalendar([]);
7578
setUpdateModalShown(false);
79+
router.replace('/oobe'); // redirect to onboarding after data wipe
7680
}
7781

7882
return (

0 commit comments

Comments
 (0)