File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/editor/src/app/documentRenderers/richtext Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const RichTextRenderer: React.FC<Props> = observer((props) => {
2929 const frameClientIds = new Set < number > ( ) ;
3030
3131 // eslint-disable-next-line @typescript-eslint/no-explicit-any
32- props . document . awareness . on ( "change" , ( changes : any , origin : any ) => {
32+ props . document . awareness ? .on ( "change" , ( changes : any , origin : any ) => {
3333 if ( origin !== provider ) {
3434 return ;
3535 }
@@ -44,11 +44,13 @@ const RichTextRenderer: React.FC<Props> = observer((props) => {
4444
4545 const removePresence = ( ) => {
4646 // remove cursor from awareness when we navigate away
47- awarenessProtocol . removeAwarenessStates (
48- props . document . awareness ,
49- [ ...frameClientIds ] ,
50- "window unload" ,
51- ) ;
47+ if ( props . document . awareness ) {
48+ awarenessProtocol . removeAwarenessStates (
49+ props . document . awareness ,
50+ [ ...frameClientIds ] ,
51+ "window unload" ,
52+ ) ;
53+ }
5254 } ;
5355
5456 window . addEventListener ( "beforeunload" , removePresence ) ;
You can’t perform that action at this time.
0 commit comments