mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-04-10 16:30:18 +02:00
eslint for mobile + new maps API key + cleaning
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { createContext, useContext, useMemo } from "react";
|
||||
import { io } from "socket.io-client";
|
||||
|
||||
const SOCKET_URL = `ws://0.0.0.0/player`;
|
||||
const SERVER_URL = `http://0.0.0.0/back`;
|
||||
const IP = "172.16.1.180";
|
||||
const SOCKET_URL = `ws://${IP}/player`;
|
||||
const SERVER_URL = `http://${IP}/back`;
|
||||
|
||||
export const teamSocket = io(SOCKET_URL, {
|
||||
path: "/back/socket.io",
|
||||
@@ -10,13 +11,14 @@ export const teamSocket = io(SOCKET_URL, {
|
||||
|
||||
export const SocketContext = createContext();
|
||||
|
||||
export default function SocketProvider({ children }) {
|
||||
const value = useMemo(() => ({ teamSocket, SERVER_URL }), [teamSocket]);
|
||||
export const SocketProvider = ({ children }) => {
|
||||
const value = useMemo(() => ({ teamSocket, SERVER_URL }), []);
|
||||
|
||||
return (
|
||||
<SocketContext.Provider value={value}>{children}</SocketContext.Provider>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export function useSocket() {
|
||||
export const useSocket = () => {
|
||||
return useContext(SocketContext);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user