Skip to content

Commit

Permalink
feat: move room connection error display to console
Browse files Browse the repository at this point in the history
  • Loading branch information
MrQuackDuck committed Dec 18, 2024
1 parent a927ebb commit 3578f79
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pages/chat/lib/hooks/useChatConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { distinctMessages, MessageModel } from "@/entities/Message";
import { RoomModel } from "@/entities/Room";
import { DetailedUserModel, UserModel } from "@/entities/User";
import { API_URL } from "@/shared/api";
import { AccessTokenFactory, NotificationsSettingsContext, useErrorToast, useInfoToast, useJwt } from "@/shared/lib";
import { AccessTokenFactory, NotificationsSettingsContext, useInfoToast, useJwt } from "@/shared/lib";
import { SignalRHubResult } from "@/shared/model";
import { ChatConnection } from "@/widgets/chat-section";

Expand All @@ -23,7 +23,6 @@ export const useChatConnection = (
setSelectedRoom: React.Dispatch<React.SetStateAction<RoomModel>>
) => {
const showInfoToast = useInfoToast();
const showErrorToast = useErrorToast();
const getJwt = useJwt();
const joinedRoomsRef = useRef(joinedRooms);
const selectedRoomRef = useRef(selectedRoom);
Expand Down Expand Up @@ -251,7 +250,7 @@ export const useChatConnection = (
});
})
.catch((e) => {
showErrorToast(`Couldn't connect to the room`, `We weren't able to establish a connection. Error: ${e}.`);
console.error(e, "Couldn't connect to the room");
});

connection.onclose(() => {
Expand Down

0 comments on commit 3578f79

Please sign in to comment.