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

Commit

Permalink
Release 6.6.2
Browse files Browse the repository at this point in the history
Development => Beta (release 6.6.2)
  • Loading branch information
Vilerio authored Mar 15, 2024
2 parents 689dec3 + 7041ca0 commit f0daa21
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 100 deletions.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Papillon",
"slug": "papillonvex",
"scheme": "papillon",
"version": "6.6.1",
"version": "6.6.2",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "automatic",
Expand Down
3 changes: 3 additions & 0 deletions fetch/background/Lessons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const notifyLessons = async (lessons: PapillonLesson[]) => {
for (const lesson of lessonsWithStatus) {
const lessonStart = new Date(lesson.start);
lessonStart.setMinutes(lessonStart.getMinutes() - 30);

// if lessonStart is in the past
if (lessonStart.getTime() < Date.now()) continue;

const lessonID = (lesson.subject?.name ? lesson.subject.name : '') + new Date(lesson.start).getTime();

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "papillonvex",
"version": "6.6.1",
"version": "6.6.2",
"canal": "beta",
"private": true,
"scripts": {
Expand Down
12 changes: 5 additions & 7 deletions stacks/AuthStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@ const AuthStack = ({ navigation }) => {
options: {
headerTitle: 'Se connecter',
headerTransparent: true,
presentation: 'modal',
}
},
{
name: 'NGPronoteWebviewLogin',
component: require('../views/NewAuthStack/Pronote/NGPronoteWebviewLogin').default,
options: {
headerTitle: 'Portail de l\'établissement',
presentation: 'modal',
headerBackTitle: 'Retour',
headerBackTitleVisible: false,
}
},
{
name: 'LoginURL',
component: require('../views/NewAuthStack/Pronote/LoginURL').default,
options: {
headerTitle: 'Connexion via PRONOTE',
presentation: 'modal',
headerTitle: 'Connexion via URL',
headerBackTitle: 'Retour',
}
},
{
Expand All @@ -81,16 +81,14 @@ const AuthStack = ({ navigation }) => {
options: {
headerTitle: 'Localiser mon établissement',
headerBackTitle: 'Retour',
presentation: 'modal',
}
},
{
name: 'LocateEtabList',
component: require('../views/NewAuthStack/Pronote/LocateEtabList').default,
options: {
headerTitle: 'Établissements',
headerBackTitle: 'Ville',
presentation: 'modal',
headerBackTitle: 'Localiser',
}
},
{
Expand Down
12 changes: 4 additions & 8 deletions views/NewAuthStack/Pronote/LocateEtabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ const LocateEtabList = ({ route, navigation }: {
instanceURL = instanceURL.replace('index-education.net', 'pronote.toutatice.fr');
});

navigation.goBack();
navigation.goBack();
navigation.navigate('NGPronoteWebviewLogin', { instanceURL: instanceURL });
};

useLayoutEffect(() => {
navigation.setOptions({
headerBackTitle: location.properties.name,
headerRight: () => (
isInstancesLoading ? (
<ActivityIndicator />
Expand Down Expand Up @@ -97,11 +94,10 @@ const LocateEtabList = ({ route, navigation }: {
<StatusBar
animated
barStyle={
Platform.OS === 'ios'
? 'light-content'
: UIColors.theme === 'light'
? 'dark-content'
: 'light-content'
UIColors.dark ?
'light-content'
:
'dark-content'
}
/>

Expand Down
23 changes: 18 additions & 5 deletions views/NewAuthStack/Pronote/LoginURL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import AlertBottomSheet from '../../../interface/AlertBottomSheet';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { TouchableOpacity } from 'react-native-gesture-handler';

import * as Clipboard from 'expo-clipboard';

const LoginURL = ({ navigation }: {
navigation: any // TODO
}) => {
Expand All @@ -23,6 +25,8 @@ const LoginURL = ({ navigation }: {
const [currentURL, setCurrentURL] = React.useState('');
const [urlAlert, setURLAlert] = React.useState(false);

const textInputRef = React.useRef(null);

const login = () => {
if (!currentURL || !currentURL.startsWith('http')) {
setURLAlert(true);
Expand All @@ -35,6 +39,16 @@ const LoginURL = ({ navigation }: {
});
};

// get url from clipboard if it's a pronote url
React.useEffect(() => {
(async () => {
const clipboard = await Clipboard.getUrlAsync();
if (clipboard && clipboard.includes('/pronote/')) {
setCurrentURL(clipboard);
}
})();
}, []);

return (
<ScrollView
contentInsetAdjustmentBehavior='automatic'
Expand All @@ -52,13 +66,10 @@ const LoginURL = ({ navigation }: {
<StatusBar
animated
barStyle={
Platform.OS === 'ios' ?
UIColors.dark ?
'light-content'
:
UIColors.theme == 'light' ?
'dark-content'
:
'light-content'
'dark-content'
}
/>

Expand All @@ -71,6 +82,7 @@ const LoginURL = ({ navigation }: {
style={[styles.input, {color: UIColors.text}]}
value={currentURL}
onChangeText={text => setCurrentURL(text)}
ref={textInputRef}
/>
</View>

Expand Down Expand Up @@ -104,6 +116,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 16,
paddingRight: 16,
},

input: {
Expand Down
Loading

0 comments on commit f0daa21

Please sign in to comment.