mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #4230 from overleaf/msm-prevent-chat-render
Prevent chat-pane from being rendered when user is not defined GitOrigin-RevId: d044c5d9dc7f07fa535bed746b46a6cff1f78dff
This commit is contained in:
parent
1c24ecd33e
commit
834c7181e5
1 changed files with 5 additions and 1 deletions
|
@ -18,7 +18,7 @@ const ChatPane = React.memo(function ChatPane() {
|
|||
|
||||
const { chatIsOpen } = useLayoutContext({ chatIsOpen: PropTypes.bool })
|
||||
const { user } = useApplicationContext({
|
||||
user: PropTypes.shape({ id: PropTypes.string.isRequired }.isRequired),
|
||||
user: PropTypes.shape({ id: PropTypes.string.isRequired }),
|
||||
})
|
||||
|
||||
const {
|
||||
|
@ -55,6 +55,10 @@ const ChatPane = React.memo(function ChatPane() {
|
|||
throw error
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<aside className="chat">
|
||||
<InfiniteScroll
|
||||
|
|
Loading…
Reference in a new issue