chore: bump socket.io-client to 4.5.4

This commit is contained in:
dwelle
2022-12-31 19:28:28 +01:00
parent c8370b394c
commit 480db3f5b6
6 changed files with 74 additions and 167 deletions

View File

@@ -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 });