Tweak the order of events that's happening in the main site processor
This commit is contained in:
parent
794f0a62c6
commit
826b118548
1 changed files with 8 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import App from "./App.svelte";
|
||||
import type { IServerInfo } from "common";
|
||||
import io from "socket.io-client";
|
||||
import type { IServerInfoResponse } from "common";
|
||||
import App from "./App.svelte";
|
||||
|
||||
let url = "/";
|
||||
if (import.meta.env.DEV) {
|
||||
|
|
@ -9,12 +9,16 @@ if (import.meta.env.DEV) {
|
|||
|
||||
export const socket = io(url);
|
||||
|
||||
socket.once("res:server.info", (data: IServerInfoResponse) => {
|
||||
console.table(data);
|
||||
|
||||
socket.on(`res:error`, (data) => {
|
||||
console.error(data);
|
||||
});
|
||||
|
||||
socket.on("connect", () => {
|
||||
console.log("Connected to websocket server. Server info below:");
|
||||
socket.once("res:server.info", (data: IServerInfo) => {
|
||||
console.table(data);
|
||||
});
|
||||
socket.emit("req:server.info");
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue