mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
bugfix: connect to remote server
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import { createContext, useContext, useEffect, useState } from 'react';
|
||||
import io from 'socket.io-client';
|
||||
import { serverURL } from '../api/apiConstants';
|
||||
import { NODE_PORT } from '../api/apiConstants';
|
||||
|
||||
export const SocketContext = createContext([[], () => {}]);
|
||||
// get origin from URL
|
||||
const serverURL = window.location.origin.replace(
|
||||
window.location.port,
|
||||
`${NODE_PORT}/`
|
||||
);
|
||||
|
||||
const SocketContext = createContext([[], () => {}]);
|
||||
|
||||
export const useSocket = () => {
|
||||
return useContext(SocketContext);
|
||||
|
||||
Reference in New Issue
Block a user