mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-04-11 00:30:19 +02:00
Traduction + alias + routing + refactoring
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
import { createContext, useContext, useState, useEffect, useCallback, useMemo } from "react";
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
// Hook
|
||||
import { useLocalStorage } from '../hooks/useLocalStorage';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
// Services
|
||||
import { emitLogin, emitLogout, emitBattery, emitDeviceInfo } from "../services/socket/emitters";
|
||||
import { emitLogin, emitLogout, emitBattery, emitDeviceInfo } from "@/services/socket/emitters";
|
||||
|
||||
const AuthContext = createContext();
|
||||
const AuthContext = createContext(null);
|
||||
|
||||
export const AuthProvider = ({ children }) => {
|
||||
const [loggedIn, setLoggedIn] = useState(false);
|
||||
@@ -34,12 +34,14 @@ export const AuthProvider = ({ children }) => {
|
||||
emitLogout();
|
||||
}, [loggedIn, setTeamId]);
|
||||
|
||||
/*
|
||||
// Try to log in with saved teamId
|
||||
useEffect(() => {
|
||||
if (!loggedIn && teamId) {
|
||||
login(teamId);
|
||||
}
|
||||
}, [loggedIn, teamId, login]);
|
||||
*/
|
||||
|
||||
// Emit battery level and phone model at log in
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// React
|
||||
import { createContext, useContext, useMemo, useState, useEffect } from "react";
|
||||
// Context
|
||||
import { useAuth } from "./authContext";
|
||||
import { useAuth } from "@/contexts/authContext";
|
||||
// Services
|
||||
import { socket } from "../services/socket/connection";
|
||||
import { socket } from "@/services/socket/connection";
|
||||
// Constants
|
||||
import { GAME_STATE } from "../constants";
|
||||
import { GAME_STATE } from "@/constants";
|
||||
|
||||
const TeamContext = createContext();
|
||||
const TeamContext = createContext(null);
|
||||
|
||||
const useOnEvent = (event, callback) => {
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user