mirror of
https://github.com/screentinker/screentinker.git
synced 2026-06-21 21:52:33 -06:00
fix(socket): prefer WebSocket transport for dashboard socket
Mirrors the player-side fix in 1aee4f2 - skips the polling->WS
upgrade dance that was causing the dashboard socket to flicker
when Apply burst its fetch traffic.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2725ea9152
commit
3294525f4c
|
|
@ -4,7 +4,11 @@ const listeners = new Map();
|
||||||
export function connectSocket() {
|
export function connectSocket() {
|
||||||
const token = localStorage.getItem('token');
|
const token = localStorage.getItem('token');
|
||||||
dashboardSocket = io('/dashboard', {
|
dashboardSocket = io('/dashboard', {
|
||||||
auth: { token }
|
auth: { token },
|
||||||
|
// Prefer WebSocket; fall back to polling on the same connect attempt.
|
||||||
|
// Mirrors the player-side fix in 1aee4f2 - skips the polling->WS upgrade
|
||||||
|
// dance that was causing the dashboard socket to flicker on Apply.
|
||||||
|
transports: ['websocket', 'polling']
|
||||||
});
|
});
|
||||||
|
|
||||||
dashboardSocket.on('connect', () => {
|
dashboardSocket.on('connect', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue