Skip to content

Commit 078cd9d

Browse files
committed
fix: Renombrar usePasarela a useRelay y actualizar workflow
1 parent 7b29e78 commit 078cd9d

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches:
6-
- main
76
- master
87
workflow_dispatch:
98

@@ -32,9 +31,9 @@ jobs:
3231
- name: Install dependencies
3332
run: npm ci
3433

35-
- name: Build
34+
- name: Build with production Relay URL
3635
env:
37-
VITE_RELAY_URL: wss://demo.relay.coderic.net
36+
VITE_RELAY_URL: "wss://demo.relay.coderic.net"
3837
run: npm run build
3938

4039
- name: Setup Pages
@@ -43,12 +42,12 @@ jobs:
4342
- name: Upload artifact
4443
uses: actions/upload-pages-artifact@v3
4544
with:
46-
path: './dist'
45+
path: dist
4746

4847
deploy:
4948
environment:
5049
name: github-pages
51-
url: https://coderic.org/relay-ejemplo-cola-turnos/
50+
url: ${{ steps.deployment.outputs.page_url }}
5251
runs-on: ubuntu-latest
5352
needs: build
5453
steps:

src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect, useMemo, useRef } from 'react';
2-
import { useRelay } from './hooks/useRelay';
2+
import { useRelay } from './hooks/usePasarela';
33
import './App.css';
44

55
const SESSION_ID = localStorage.getItem('colaSession') || (() => {
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { useEffect, useState, useCallback, useRef } from 'react';
22
import { io } from 'socket.io-client';
33

4-
// Detectar si estamos en producción (coderic.org)
5-
const isProduction = typeof window !== 'undefined' &&
6-
(window.location.hostname === 'coderic.org' || window.location.hostname === 'www.coderic.org');
7-
8-
const RELAY_URL = import.meta.env.VITE_RELAY_URL ||
9-
(isProduction ? 'wss://demo.relay.coderic.net' : 'http://localhost:5000');
4+
const RELAY_URL = import.meta.env.VITE_RELAY_URL || 'http://localhost:5000';
105

116
export function useRelay(userId) {
127
const [connected, setConnected] = useState(false);

0 commit comments

Comments
 (0)