mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +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 () => {
|
componentDidMount = async () => {
|
||||||
|
// check if user is logged in
|
||||||
|
if (!SessionModel.token) {
|
||||||
|
return this.setState({
|
||||||
|
connecting: false,
|
||||||
|
noAuthed: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
await this.joinSocketRoom()
|
await this.joinSocketRoom()
|
||||||
|
|
||||||
app.ctx = {
|
app.ctx = {
|
||||||
@ -255,6 +263,12 @@ export default class LiveChat extends React.Component {
|
|||||||
</div>
|
</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
|
return <div
|
||||||
className={classnames(
|
className={classnames(
|
||||||
"liveChat",
|
"liveChat",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user