mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-21 00:10:33 +02:00
chore: bump socket.io-client to 4.5.4
This commit is contained in:
@@ -414,7 +414,27 @@ class Collab extends PureComponent<Props, CollabState> {
|
||||
roomKey,
|
||||
);
|
||||
|
||||
this.portal.socket.once("connect_error", fallbackInitializationHandler);
|
||||
this.portal.socket.on("disconnect", (reason) => {
|
||||
// reason `io server disconnect` probably means CORS issue
|
||||
console.warn(
|
||||
`${
|
||||
this.portal.socketInitialized ? "initialized" : "uninitialized"
|
||||
} socket disconnected from server: ${reason}`,
|
||||
);
|
||||
this.setState({
|
||||
errorMessage: this.portal.socketInitialized
|
||||
? t("errors.socketDisconnected")
|
||||
: t("errors.socketConnectionError"),
|
||||
});
|
||||
fallbackInitializationHandler();
|
||||
});
|
||||
|
||||
this.portal.socket.once("connect_error", (err: any) => {
|
||||
this.setState({
|
||||
errorMessage: t("errors.socketConnectionError"),
|
||||
});
|
||||
fallbackInitializationHandler();
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.setState({ errorMessage: error.message });
|
||||
|
@@ -19,10 +19,11 @@ import { newElementWith } from "../../element/mutateElement";
|
||||
import { BroadcastedExcalidrawElement } from "./reconciliation";
|
||||
import { encryptData } from "../../data/encryption";
|
||||
import { PRECEDING_ELEMENT_KEY } from "../../constants";
|
||||
import { Socket } from "socket.io-client";
|
||||
|
||||
class Portal {
|
||||
collab: TCollabClass;
|
||||
socket: SocketIOClient.Socket | null = null;
|
||||
socket: Socket | null = null;
|
||||
socketInitialized: boolean = false; // we don't want the socket to emit any updates until it is fully initialized
|
||||
roomId: string | null = null;
|
||||
roomKey: string | null = null;
|
||||
@@ -32,7 +33,7 @@ class Portal {
|
||||
this.collab = collab;
|
||||
}
|
||||
|
||||
open(socket: SocketIOClient.Socket, id: string, key: string) {
|
||||
open(socket: Socket, id: string, key: string) {
|
||||
this.socket = socket;
|
||||
this.roomId = id;
|
||||
this.roomKey = key;
|
||||
|
Reference in New Issue
Block a user