mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 07:11:53 +00:00
open socket when main component mounts
This commit is contained in:
parent
7a8518caf6
commit
5d69f56d7a
2 changed files with 3 additions and 2 deletions
|
@ -2,7 +2,7 @@ const React = require("react");
|
|||
const ReactDOM = require("react-dom");
|
||||
const App = require("javascripts/components/main");
|
||||
const io = require("socket.io-client");
|
||||
const socketUrl = window.location.protocol + "//" + window.location.hostname + ":"+ window.location.port;
|
||||
const socketUrl = window.location.origin;
|
||||
const socket = io(socketUrl);
|
||||
|
||||
module.exports = function (mount) {
|
||||
|
|
|
@ -44,7 +44,8 @@ const App = React.createClass({
|
|||
this.setState({ status: "banned" });
|
||||
}
|
||||
});
|
||||
this.setState({ socket: socket });
|
||||
this.setState({ socket: socket });
|
||||
socket.open();
|
||||
},
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in a new issue