From 924195c10730a447bd96675ef7ff1cc5cf1cf9eb Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Mon, 10 Apr 2023 16:21:46 +0000 Subject: [PATCH] support not authed --- packages/app/src/components/LiveChat/index.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/app/src/components/LiveChat/index.jsx b/packages/app/src/components/LiveChat/index.jsx index 4df8d662..e4aa4d6d 100755 --- a/packages/app/src/components/LiveChat/index.jsx +++ b/packages/app/src/components/LiveChat/index.jsx @@ -198,6 +198,14 @@ export default class LiveChat extends React.Component { } componentDidMount = async () => { + // check if user is logged in + if (!SessionModel.token) { + return this.setState({ + connecting: false, + noAuthed: true + }) + } + await this.joinSocketRoom() app.ctx = { @@ -255,6 +263,12 @@ export default class LiveChat extends React.Component { } + if (this.state.noAuthed) { + return
+ +
+ } + return