Updated the SocketUtil.js

This commit is contained in:
2023-08-05 21:53:13 +02:00
parent 41a283e25f
commit fd78c88ef3

View File

@ -1,6 +1,7 @@
import { io } from 'socket.io-client';
const URL = process.env.NODE_ENV === 'production' ? "https://tools-api.gnmyt.dev/" : "http://localhost:7182/";
const URL = process.env.NODE_ENV === 'production' ? (localStorage.getItem("url") || "https://tools-api.gnmyt.dev/")
: "http://localhost:7182/";
export const createConnection = (type) => {
const socket = io(URL, {autoConnect: false});