|
@@ -57,6 +57,11 @@ export function SignalRProvider({ children, accessToken, signalRCryptoUrl, signa
|
|
|
}, [chatConnected]);
|
|
}, [chatConnected]);
|
|
|
|
|
|
|
|
const initCryptoConnection = async () => {
|
|
const initCryptoConnection = async () => {
|
|
|
|
|
+ if (!signalRCryptoUrl) {
|
|
|
|
|
+ console.warn('SIGNALR_CRYPTO_URL not configured — crypto hub disabled');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
if (cryptoConnectionRef.current && cryptoConnectionRef.current.state !== signalR.HubConnectionState.Disconnected) {
|
|
if (cryptoConnectionRef.current && cryptoConnectionRef.current.state !== signalR.HubConnectionState.Disconnected) {
|
|
|
return;
|
|
return;
|
|
@@ -73,6 +78,11 @@ export function SignalRProvider({ children, accessToken, signalRCryptoUrl, signa
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const initChatConnection = async (accessToken?: string|null) => {
|
|
const initChatConnection = async (accessToken?: string|null) => {
|
|
|
|
|
+ if (!signalRChatUrl) {
|
|
|
|
|
+ console.warn('SIGNALR_CHAT_URL not configured — chat hub disabled');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
if (chatConnectionRef.current && chatConnectionRef.current.state !== signalR.HubConnectionState.Disconnected) {
|
|
if (chatConnectionRef.current && chatConnectionRef.current.state !== signalR.HubConnectionState.Disconnected) {
|
|
|
await chatConnectionRef.current.stop();
|
|
await chatConnectionRef.current.stop();
|