Application qui marche sur android et ios
continuous-integration/drone/push Build is failing Details

Persistance
Thomas Chazot 2 years ago
parent 821982fb99
commit 95de9e2f34

@ -26,14 +26,9 @@ export const MANAGER_GAME = new ManagerGame(new LoaderGameApi);
export default function App() {
return (
<Text>CC</Text>
/*
<Provider store={store}>
<MainTabNavigator/>
</Provider>
*/
);
}

@ -3,11 +3,7 @@ module.exports = function(api) {
return {
presets: [
['babel-preset-expo'],
'@babel/preset-typescript',
],
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript', '@babel/preset-react',
['@babel/preset-env', { targets: { node: 'current' } }]
],
};
};

@ -45,7 +45,11 @@
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/preset-typescript": "^7.18.6",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.5.5",
"@jest/globals": "^29.3.1",
"@types/jest": "^29.2.3",
"@types/jquery": "^3.5.14",
@ -53,6 +57,7 @@
"@types/node": "^18.8.4",
"@types/react": "~18.0.14",
"@types/react-native": "~0.69.1",
"babel-preset-react-native": "^4.0.0",
"ts-jest": "^29.0.3",
"typescript": "^4.9.3"
},

@ -86,9 +86,8 @@ function CookieClicker(props: { navigation: any}){
}
function endGame(){
let tmp: User | null;
tmp=MANAGER_USER.getCurrentUser();
if (tmp!=null){
const tmp=MANAGER_USER.getCurrentUser();
if (tmp!==null){
if (MANAGER_MATCH.getCurrentMatch()?.getTabUsers().includes(tmp)){
MANAGER_MATCH.getCurrentMatch()?.updatePostMatch(tmp, points);
setUser(tmp);

@ -37,8 +37,7 @@ export const BotBar :
(the string must be the name of the screen)
*/
FC<{ nav: any, state?: String }> =
({nav, state}) =>
{
({ nav, state }) => {
const setTabSkin = useStoreStore((state) => state.setTabSkin);
const setTabConv = useConversationStore((state) => state.setTabConv);
@ -46,9 +45,9 @@ FC<{nav: any, state?: String}> =
const handleStoreChange = useCallback(async () => {
let tabSkinStore = [...tabSkinApp];
let tmp=MANAGER_USER.getCurrentUser()?.getTabSkin();
if (tmp!=undefined){
tmp.forEach(skin => {
// const tmp=MANAGER_USER.getCurrentUser()?.getTabSkin();
// if (tmp!==undefined){
MANAGER_USER.getCurrentUser()?.getTabSkin()?.forEach(skin => {
for (let i = 0; i < tabSkinStore.length; i++) {
if (skin.isEqual(tabSkinStore[i])) {
tabSkinStore.splice(i, 1);
@ -56,12 +55,12 @@ FC<{nav: any, state?: String}> =
}
});
setTabSkin(tabSkinStore);
}
// }
}, []);
const handleConversationChange = useCallback(async () => {
let tmp=MANAGER_USER.getCurrentUser();
if (tmp!=undefined){
const tmp = MANAGER_USER.getCurrentUser();
if (tmp !== null) {
await MANAGER_CONVERSATION.getLoaderConversation().loadByUser(tmp).then((res) => {
MANAGER_CONVERSATION.setCurrentTabConv(res);
setTabConv(res);

@ -30,8 +30,8 @@ FC<{game: Game, nav: any}> =
const createNewMatchSolo = useCallback(async (game : Game, nav: any) => {
const m=new MatchCreator();
let tmp=MANAGER_USER.getCurrentUser();
if (tmp!=null){
const tmp=MANAGER_USER.getCurrentUser();
if (tmp!==null){
let match=await m.createMatch(tmp, game);
MANAGER_MATCH.setCurrentMatch(match);
setMatch(match);

@ -30,8 +30,7 @@ export const SkinComponent :
* state : Indicates from wich screen the component has been called
*/
FC<{ nav: any, skin: Skin, state: String }> =
({nav, skin, state}) =>
{
({ nav, skin, state }) => {
const navigation = nav;
@ -45,7 +44,7 @@ FC<{nav : any, skin: Skin, state: String}> =
async function changerSkin(skin: Skin) {
const m = new UserSkinModifier();
const tmp = MANAGER_USER.getCurrentUser();
if (tmp!=null){
if (tmp !== null) {
await m.changeCurrentSkin(tmp, skin);
setUser(tmp);
MANAGER_USER.setCurrentUser(tmp);
@ -55,9 +54,9 @@ FC<{nav : any, skin: Skin, state: String}> =
const handleStoreChange = useCallback(async () => {
let tabSkinStore = [...tabSkinApp];
let tmp=MANAGER_USER.getCurrentUser()?.getTabSkin();
if (tmp!=undefined){
tmp.forEach(skin => {
// const tmp=MANAGER_USER.getCurrentUser()?.getTabSkin();
// if (tmp!=undefined){
MANAGER_USER.getCurrentUser()?.getTabSkin()?.forEach(skin => {
for (let i = 0; i < tabSkinStore.length; i++) {
if (skin.isEqual(tabSkinStore[i])) {
tabSkinStore.splice(i, 1);
@ -65,7 +64,7 @@ FC<{nav : any, skin: Skin, state: String}> =
}
});
setTabSkin(tabSkinStore);
}
//}
}, []);
@ -74,7 +73,7 @@ FC<{nav : any, skin: Skin, state: String}> =
const mSkin = new UserSkinModifier();
const mCoins = new ManagerCoinsUser();
const tmp = MANAGER_USER.getCurrentUser();
if (tmp!=null){
if (tmp !== null) {
await mCoins.removeCoins(tmp, skin.getSkinCost()).then(async (res) => {
if (res == true) {

@ -31,7 +31,6 @@ export const currentUserSlice = createSlice({
updatePseudo: (state, action: PayloadAction<string>) =>{
const newUser: User = new User(currentUser.getId(), currentUser.getUsername(), currentUser.getPassword(), currentUser.getNationality(), currentUser.getSexe(), currentUser.getDateOfBirth());
console.log(currentUser);
newUser.setUsername(action.payload);
return {
...state,

@ -81,8 +81,8 @@ function Home(props: { navigation: any; }) {
const handleGame = useCallback(async (typeJeu: string) => {
let tmp=MANAGER_GAME.getTabGame();
if (tmp==null){
const tmp = MANAGER_GAME.getTabGame();
if (tmp === null) {
await MANAGER_GAME.getLoaderGame().loadAllGame().then((res) => {
MANAGER_GAME.setTabGame(res);
setTabGame(res);

@ -30,8 +30,8 @@ function Settings(props: { navigation: any; }) {
async function changeUsername(username:string){
const m = new UserModificationManager();
let tmp=MANAGER_USER.getCurrentUser();
if (tmp!=null){
const tmp=MANAGER_USER.getCurrentUser();
if (tmp!==null){
await m.changeUsername(tmp, username);
setUser(tmp);
MANAGER_USER.setCurrentUser(tmp);
@ -40,8 +40,8 @@ function Settings(props: { navigation: any; }) {
async function changePassword(password:string){
const m = new UserModificationManager();
let tmp=MANAGER_USER.getCurrentUser();
if (tmp!=null){
const tmp=MANAGER_USER.getCurrentUser();
if (tmp!==null){
await m.changePassword(tmp, password);
setUser(tmp);
MANAGER_USER.setCurrentUser(tmp);

@ -26,7 +26,6 @@ function SignUp(props: { navigation: any; }) {
function onDateSelected(event : DateTimePickerEvent, value : Date | undefined) {
console.log(value);
if (value != undefined) {
setDate(value);
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1 @@
Subproject commit b2c910a85ed84cb7e5108e7cb3406a2e825a858f
Loading…
Cancel
Save