mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
support not authed
This commit is contained in:
parent
0125d107cd
commit
924195c107
@ -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 {
|
||||
</div>
|
||||
}
|
||||
|
||||
if (this.state.noAuthed) {
|
||||
return <div className="liveChat empty">
|
||||
<antd.Empty description="You must be logged in to use this feature" />
|
||||
</div>
|
||||
}
|
||||
|
||||
return <div
|
||||
className={classnames(
|
||||
"liveChat",
|
||||
|
Loading…
x
Reference in New Issue
Block a user