Traduction + alias + routing + refactoring

This commit is contained in:
Sebastien Riviere
2026-02-20 22:00:54 +01:00
parent 776bbcd723
commit 76ee9674de
50 changed files with 2978 additions and 1746 deletions

View File

@@ -1,10 +1,11 @@
// Constants
import { SERVER_URL } from "../../constants";
import { SERVER_URL } from "@/constants";
export const uploadTeamImage = async (id, imageUri) => {
if (!imageUri || !id) return;
const data = new FormData();
// @ts-ignore
data.append('file', {
uri: imageUri,
name: 'photo.jpg',
@@ -26,7 +27,7 @@ export const uploadTeamImage = async (id, imageUri) => {
};
export const enemyImage = (id) => {
if (!id) return require('../assets/images/missing_image.jpg');
if (!id) return require('@/assets/images/missing_image.jpg');
return {uri: `${SERVER_URL}/photo/enemy?team=${id}`};
};

View File

@@ -1,7 +1,7 @@
// Socket
import { io } from "socket.io-client";
// Constants
import { SOCKET_URL } from "../../constants";
import { SOCKET_URL } from "@/constants";
export const socket = io(SOCKET_URL, {
path: "/back/socket.io"

View File

@@ -1,5 +1,5 @@
// Services
import { socket } from "./connection";
import { socket } from "@/services/socket/connection";
const customEmit = (event, ...args) => {
if (!socket?.connected) return false;
@@ -21,7 +21,8 @@ const customEmitCallback = (event, ...args) => {
socket.emit(event, ...args, (response) => {
clearTimeout(timeout);
resolve(response.length > 1 ? response : response[0]);
console.log("Received : ", response);
resolve(response);
});
});
};

View File

@@ -2,9 +2,9 @@
import { defineTask, isTaskRegisteredAsync } from "expo-task-manager";
import * as Location from 'expo-location';
// Services
import { emitUpdatePosition } from "../socket/emitters";
import { emitUpdatePosition } from "@/services/socket/emitters";
// Constants
import { TASKS, LOCATION_PARAMETERS } from "../../constants";
import { TASKS, LOCATION_PARAMETERS } from "@/constants";
// Task
@@ -15,6 +15,7 @@ defineTask(TASKS.BACKGROUND_LOCATION, async ({ data, error }) => {
return;
}
if (data) {
// @ts-ignore
const { locations } = data;
if (locations.length == 0) {
console.log("No location measured.");