forked from vergnet/application-amicale
fix planex initial group
This commit is contained in:
parent
35a4b377f8
commit
92eedda98b
1 changed files with 10 additions and 7 deletions
|
@ -46,7 +46,6 @@ import MascotPopup from '../../components/Mascot/MascotPopup';
|
||||||
import { getPrettierPlanexGroupName } from '../../utils/Utils';
|
import { getPrettierPlanexGroupName } from '../../utils/Utils';
|
||||||
import GENERAL_STYLES from '../../constants/Styles';
|
import GENERAL_STYLES from '../../constants/Styles';
|
||||||
import Urls from '../../constants/Urls';
|
import Urls from '../../constants/Urls';
|
||||||
import { useMountEffect } from '../../utils/customHooks';
|
|
||||||
|
|
||||||
// // JS + JQuery functions used to remove alpha from events. Copy paste in browser console for quick testing
|
// // JS + JQuery functions used to remove alpha from events. Copy paste in browser console for quick testing
|
||||||
// // Remove alpha from given Jquery node
|
// // Remove alpha from given Jquery node
|
||||||
|
@ -164,11 +163,8 @@ function PlanexScreen(props: Props) {
|
||||||
}
|
}
|
||||||
>();
|
>();
|
||||||
const [injectJS, setInjectJS] = useState('');
|
const [injectJS, setInjectJS] = useState('');
|
||||||
const [currentGroup, setCurrentGroup] = useState<
|
|
||||||
PlanexGroupType | undefined
|
|
||||||
>();
|
|
||||||
|
|
||||||
useMountEffect(() => {
|
const getCurrentGroup = (): PlanexGroupType | undefined => {
|
||||||
let currentGroupString = AsyncStorageManager.getString(
|
let currentGroupString = AsyncStorageManager.getString(
|
||||||
AsyncStorageManager.PREFERENCES.planexCurrentGroup.key
|
AsyncStorageManager.PREFERENCES.planexCurrentGroup.key
|
||||||
);
|
);
|
||||||
|
@ -178,9 +174,14 @@ function PlanexScreen(props: Props) {
|
||||||
navigation.setOptions({
|
navigation.setOptions({
|
||||||
title: getPrettierPlanexGroupName(group.name),
|
title: getPrettierPlanexGroupName(group.name),
|
||||||
});
|
});
|
||||||
setCurrentGroup(group);
|
return group;
|
||||||
}
|
}
|
||||||
});
|
return undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
const [currentGroup, setCurrentGroup] = useState<PlanexGroupType | undefined>(
|
||||||
|
getCurrentGroup()
|
||||||
|
);
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
|
@ -328,6 +329,8 @@ function PlanexScreen(props: Props) {
|
||||||
* @param groupID The current group selected
|
* @param groupID The current group selected
|
||||||
*/
|
*/
|
||||||
const generateInjectedJS = (group: PlanexGroupType | undefined) => {
|
const generateInjectedJS = (group: PlanexGroupType | undefined) => {
|
||||||
|
console.log(group);
|
||||||
|
|
||||||
let customInjectedJS = `$(document).ready(function() {
|
let customInjectedJS = `$(document).ready(function() {
|
||||||
${OBSERVE_MUTATIONS_INJECTED}
|
${OBSERVE_MUTATIONS_INJECTED}
|
||||||
${INJECT_STYLE}
|
${INJECT_STYLE}
|
||||||
|
|
Loading…
Reference in a new issue