fix: refactor css

This commit is contained in:
abdou6666 2025-05-01 16:08:09 +01:00
parent 917d497b89
commit d62c2b5aff
3 changed files with 15 additions and 15 deletions

View File

@ -38,3 +38,14 @@
opacity: 1; opacity: 1;
transition: 0s; transition: 0s;
} }
.sc-chat--attempt-reconnect {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
gap: 1rem;
}

View File

@ -33,18 +33,7 @@ const ConnectionLost: React.FC = () => {
style={{ backgroundColor: colors.messageList.bg }} style={{ backgroundColor: colors.messageList.bg }}
> >
{loading ? ( {loading ? (
<div <div className="sc-chat--attempt-reconnect">
style={{
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
textAlign: "center",
gap: "1rem",
}}
>
<h3>{t("messages.attempting_reconnect")}</h3> <h3>{t("messages.attempting_reconnect")}</h3>
<LoadingIcon color={colors.button.text} /> <LoadingIcon color={colors.button.text} />
</div> </div>

View File

@ -416,9 +416,9 @@ const ChatProvider: React.FC<{
return () => { return () => {
socketCtx.socket.io.off("reconnect", reSubscribe); socketCtx.socket.io.off("reconnect", reSubscribe);
socketCtx.socket.io.on("close", endConnection); socketCtx.socket.io.off("close", endConnection);
socketCtx.socket.io.on("reconnect_error", endConnection); socketCtx.socket.io.off("reconnect_error", endConnection);
socketCtx.socket.io.on("reconnect_failed", endConnection); socketCtx.socket.io.off("reconnect_failed", endConnection);
}; };
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);