pimelon-ui 0.1.57 → 0.1.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pimelon-ui",
3
- "version": "0.1.57",
3
+ "version": "0.1.58",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -2,10 +2,11 @@ import { io } from 'socket.io-client'
2
2
 
3
3
  export default function initSocket(options = {}) {
4
4
  let host = window.location.hostname
5
+ let siteName = import.meta.env.DEV ? host : window.site_name
5
6
  let socketio_port = options.port || 9000
6
7
  let port = window.location.port ? `:${socketio_port}` : ''
7
8
  let protocol = port ? 'http' : 'https'
8
- let url = `${protocol}://${host}${port}`
9
+ let url = `${protocol}://${host}${port}/${siteName}`
9
10
  let socket = io(url, { withCredentials: true })
10
11
  return socket
11
12
  }