@@ -76,7 +76,7 @@ import { setAppIcon } from "@hugofnm/expo-dynamic-app-icon";
7676// ---------------------------------------------
7777
7878// IMPORTANT !!!
79- var appVersion = '2.1.1 ' ;
79+ var appVersion = '2.1.2 ' ;
8080var isBeta = false ;
8181// IMPORTANT !!!
8282
@@ -1254,7 +1254,11 @@ function HomeScreen({ navigation }) {
12541254 async function getMyCal ( navigation ) {
12551255 setSelectable ( false ) ;
12561256 setLoading ( true ) ;
1257- calendar = await getCalendar ( ) ;
1257+ if ( nextEvent . summary == "ADE Indisponible" ) {
1258+ calendar = await getCalendarFromCache ( ) ;
1259+ } else {
1260+ calendar = await getCalendar ( ) ;
1261+ }
12581262 setSelectable ( true ) ;
12591263 setLoading ( false ) ;
12601264 navigation . navigate ( 'ShowEDT' ) ;
@@ -1377,7 +1381,7 @@ function HomeScreen({ navigation }) {
13771381 </ View >
13781382 < Text style = { { textAlign : 'left' } } variant = "displayLarge" > Salut ! 👋</ Text >
13791383 < Text style = { { textAlign : 'left' , marginBottom : 16 } } variant = 'titleMedium' > Tu es connecté·e·s sous le compte de : { "\n" } { username } - { name } </ Text >
1380- < Chip style = { { height : 48 , marginBottom : 8 , justifyContent : 'center' , flexDirection : 'row' } } textStyle = { { paddingVertical : 8 } } disabled = { ! selectable } onPress = { ( ) => handleLogin ( "notes" ) } icon = "school" > Notes (Intracursus )</ Chip >
1384+ < Chip style = { { height : 48 , marginBottom : 8 , justifyContent : 'center' , flexDirection : 'row' } } textStyle = { { paddingVertical : 8 } } disabled = { ! selectable } onPress = { ( ) => handleLogin ( "notes" ) } icon = "school" > Notes (I.U.T. )</ Chip >
13811385 < Chip style = { { height : 48 , marginBottom : 8 , justifyContent : 'center' , flexDirection : 'row' } } textStyle = { { paddingVertical : 8 } } disabled = { ! selectable } onPress = { ( ) => navigation . navigate ( ShowENT ) } icon = "briefcase-variant" > Espace Numérique de Travail</ Chip >
13821386
13831387 < Card style = { { marginBottom : 16 } } disabled = { ! selectable } onPress = { ( ) => getMyCal ( navigation ) } >
@@ -1387,8 +1391,14 @@ function HomeScreen({ navigation }) {
13871391 < Text variant = "bodyMedium" numberOfLines = { 1 } > { nextEvent . location } </ Text >
13881392 </ Card . Content >
13891393 < Card . Actions >
1390- < Chip disabled = { ! selectable } onPress = { ( ) => getNextEvent ( "force" ) } icon = "refresh" > Rafraîchir</ Chip >
1391- < Chip disabled = { ! selectable } onPress = { ( ) => getMyCal ( navigation ) } icon = "calendar" > Emploi du temps</ Chip >
1394+ < Chip style = { { marginRight : 4 } } disabled = { ! selectable } onPress = { ( ) => getNextEvent ( "force" ) } icon = "refresh" > Rafraîchir</ Chip >
1395+ { nextEvent . summary != "ADE Indisponible" ? (
1396+ < >
1397+ < Chip disabled = { ! selectable } onPress = { ( ) => getMyCal ( navigation ) } icon = "calendar" > Emploi du temps</ Chip >
1398+ </ >
1399+ ) : (
1400+ < Chip disabled = { ! selectable } onPress = { ( ) => getMyCal ( navigation ) } icon = "calendar-alert" > EDT (Hors-ligne)</ Chip >
1401+ ) }
13921402 </ Card . Actions >
13931403 </ Card >
13941404
@@ -1984,7 +1994,7 @@ function ShowGrades({ navigation }) {
19841994}
19851995
19861996// Page d'affichage de l'emploi du temps
1987- function ShowEDT ( { navigation } ) {
1997+ function ShowEDT ( { navigation } ) {
19881998 const [ cal , setCalendar ] = useState ( calendar ) ;
19891999 const [ view , setView ] = useState ( "threeDays" ) ;
19902000 const [ viewIcon , setViewIcon ] = useState ( "magnify-minus" ) ;
@@ -2012,13 +2022,14 @@ function ShowEDT({ navigation }) {
20122022 ) ;
20132023
20142024 useEffect ( ( ) => {
2025+ async function calCache ( ) {
2026+ setCalendar ( await getCalendarFromCache ( ) ) ;
2027+ }
2028+
20152029 if ( cal == null ) {
2016- async function readJSONonAwait ( ) {
2017- return await readJSONFromFile ( ) ;
2018- }
2019- cal = JSON . parse ( readJSONonAwait ( ) ) ;
2020- setCalendar ( cal ) ;
2030+ calCache ( ) ;
20212031 }
2032+
20222033 setTimeout ( ( ) => goToToday ( ) , 500 ) ;
20232034 } , [ ] ) ;
20242035
@@ -2426,9 +2437,9 @@ function IconConfig({ navigation }) {
24262437 < ScrollView style = { { paddingLeft : 25 , paddingRight : 25 } } >
24272438 < Text style = { { marginTop : 16 , textAlign : 'left' } } variant = "titleMedium" > Choisissez votre icône :</ Text >
24282439 < Chip style = { { height : 36 , justifyContent : 'center' , marginTop : 16 , borderBottomLeftRadius : 0 , borderBottomRightRadius : 0 } } disabled > Icônes officielles </ Chip >
2429- < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icon.png' ) } /> } onPress = { ( ) => changeIconHome ( "unicenotes" ) } > Par défaut </ Chip >
2440+ < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icon.png' ) } /> } onPress = { ( ) => changeIconHome ( "unicenotes" ) } > Par défaut | ✅ iOS 18 </ Chip >
24302441 < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icons/icon_magnet.png' ) } /> } onPress = { ( ) => changeIconHome ( "magnet" ) } > Magnet </ Chip >
2431- < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icons/icon_ardente.png' ) } /> } onPress = { ( ) => changeIconHome ( "ardente" ) } > Ardente </ Chip >
2442+ < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icons/icon_ardente.png' ) } /> } onPress = { ( ) => changeIconHome ( "ardente" ) } > Ardente | ✅ iOS 18 </ Chip >
24322443 < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icons/icon_beach.png' ) } /> } onPress = { ( ) => changeIconHome ( "beach" ) } > Beach </ Chip >
24332444 < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icons/icon_monaco.png' ) } /> } onPress = { ( ) => changeIconHome ( "monaco" ) } > Monaco </ Chip >
24342445 < Chip style = { { height : 48 , justifyContent : 'center' , borderRadius : 0 , marginTop : 1 } } textStyle = { { paddingVertical : 8 } } avatar = { < Image size = { 24 } source = { require ( './assets/icons/icon_melted.png' ) } /> } onPress = { ( ) => changeIconHome ( "melted" ) } > Melted </ Chip >
@@ -2749,16 +2760,16 @@ function EDTConfig({ navigation }) {
27492760 < Text style = { { marginLeft : 25 , marginRight : 25 , marginTop : 8 , textAlign : 'left' } } variant = "titleMedium" > EDT affiché : { adeid } </ Text >
27502761 < Divider style = { { marginTop : 16 , marginBottom : 16 } } />
27512762 < ScrollView style = { { paddingLeft : 25 , paddingRight : 25 , marginBottom : 16 } } >
2752- < Text style = { { marginBottom : 8 , textAlign : 'left' } } variant = "labelLarge" > Entrez un numéro étudiant pour changer l'emploi du temps affiché :</ Text >
2753- < TextInput style = { { marginTop : 8 , marginBottom : 8 } } keyboardType = 'number-pad' maxLength = { 12 } label = "Numéro étudiant" value = { tempAde } onChangeText = { setTempAde } right = { < TextInput . Icon icon = "content-save" onPress = { ( ) => selectCursus ( tempAde , true ) } /> } />
2763+ < Text style = { { textAlign : 'left' } } variant = "labelLarge" > Entrez un numéro étudiant pour changer l'emploi du temps affiché :</ Text >
2764+ < TextInput style = { { marginTop : 8 , marginBottom : 8 } } mode = 'outlined' keyboardType = 'number-pad' maxLength = { 12 } label = "Numéro étudiant" value = { tempAde } onChangeText = { setTempAde } right = { < TextInput . Icon icon = "content-save" onPress = { ( ) => selectCursus ( tempAde , true ) } /> } />
27542765 < Text style = { { marginTop : 8 , textAlign : 'left' } } variant = "labelLarge" > Ou cliquez ci-dessous pour restaurer votre emploi du temps individuel.</ Text >
27552766 < Chip style = { { height : 48 , justifyContent : 'center' , marginTop : 16 } } textStyle = { { paddingVertical : 8 } } icon = "information" onPress = { ( ) => selectCursus ( userADEData . uid , true ) } > Restaurer votre numéro : { userADEData . uid } </ Chip >
27562767 < Card style = { { marginTop : 16 } } >
27572768 < Card . Title left = { ( props ) => < Avatar . Icon { ...props } icon = "information" /> } />
27582769 < Card . Content >
27592770 < Text style = { { textAlign : 'left' } } variant = "bodyLarge" >
27602771 { userADEData . uid == "demo" || userADEData . uid == "" || userADEData . uid == null ?
2761- "Veuillez vous connecter (sur l'onglet Notes) afin de récupérer votre numéro étudiant." :
2772+ "Votre numéro étudiant est celui indiqué sur votre carte étudiant. \nOu sinon, veuillez vous connecter (sur l'onglet Notes) afin de récupérer votre numéro étudiant." :
27622773 "L'emploi du temps individuel comprend les cours de votre cursus (TD, ...) ainsi que les cours de groupes dont vous faites partie (TP, ...). " }
27632774 </ Text >
27642775 </ Card . Content >
0 commit comments