fix and update
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as React from 'react';
|
||||
import { useAuth } from '@/components/id/auth-provider';
|
||||
import { ensureApiGatewayReady, fetchUnreadNotificationCount, getWsUrl, type ChatMessage } from '@/lib/api';
|
||||
import { fetchUnreadNotificationCount, getWsUrl, type ChatMessage } from '@/lib/api';
|
||||
import { dispatchAvatarUpdated, dispatchChatRoomAvatarUpdated } from '@/lib/avatar-events';
|
||||
|
||||
const WS_RECONNECT_BASE_MS = 2_000;
|
||||
@@ -90,13 +90,6 @@ export function RealtimeProvider({ children }: { children: React.ReactNode }) {
|
||||
}
|
||||
|
||||
async function connect() {
|
||||
if (cancelled) return;
|
||||
try {
|
||||
await ensureApiGatewayReady();
|
||||
} catch {
|
||||
scheduleReconnect();
|
||||
return;
|
||||
}
|
||||
if (cancelled) return;
|
||||
const url = `${getWsUrl()}?token=${encodeURIComponent(token!)}`;
|
||||
const socket = new WebSocket(url);
|
||||
|
||||
Reference in New Issue
Block a user