import io from "socket.io-client"; // Background thread needs this, and doesn't have access to electron function isProd() { // return true; return process.env.ELECTRON_ENV !== "development"; // return state && state.isProd; } // for some reason, getBackendUrl() doesn't work here export const socket = io( isProd() ? "https://presentable-backend.herokuapp.com" : "http://localhost:4000", { transports: ["websocket"], } ); socket.on("error", (err: any) => { console.error(err); }); socket.on("connect", (shit: any) => { console.log("FOREGROUND ROOM STORE CONNECTED"); console.log(socket.id); }); socket.on("disconnect", (shit: any) => { console.log("DISCONNECTED"); console.log(socket.id); });