Release v0.2.13: Update package-lock.json and CI config
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom'
|
import { HashRouter as Router, Routes, Route, Navigate } from 'react-router-dom'
|
||||||
import { AuthProvider } from './contexts/AuthContext'
|
import { AuthProvider } from './contexts/AuthContext'
|
||||||
import { useAuth } from './hooks/useAuth'
|
import { useAuth } from './hooks/useAuth'
|
||||||
import LandingPage from './components/LandingPage'
|
import LandingPage from './components/LandingPage'
|
||||||
|
|||||||
@@ -1078,7 +1078,14 @@ export function useGameEngine(
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!token) return
|
if (!token) return
|
||||||
|
|
||||||
const wsUrl = `${import.meta.env.VITE_WS_URL || 'ws://localhost:8000'}/ws/game/${token}`
|
// Get WebSocket URL based on environment (same logic as api.ts)
|
||||||
|
const API_BASE = import.meta.env.VITE_API_URL || (
|
||||||
|
import.meta.env.PROD
|
||||||
|
? 'https://api-staging.echoesoftheash.com'
|
||||||
|
: 'http://localhost:8000'
|
||||||
|
)
|
||||||
|
const wsBase = API_BASE.replace(/^http/, 'ws')
|
||||||
|
const wsUrl = `${wsBase}/ws/game/${token}`
|
||||||
console.log('🔌 Connecting to WebSocket:', wsUrl)
|
console.log('🔌 Connecting to WebSocket:', wsUrl)
|
||||||
|
|
||||||
const ws = new WebSocket(wsUrl)
|
const ws = new WebSocket(wsUrl)
|
||||||
|
|||||||
Reference in New Issue
Block a user