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) => {
29
29
const frameClientIds = new Set < number > ( ) ;
30
30
31
31
// 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 ) => {
33
33
if ( origin !== provider ) {
34
34
return ;
35
35
}
@@ -44,11 +44,13 @@ const RichTextRenderer: React.FC<Props> = observer((props) => {
44
44
45
45
const removePresence = ( ) => {
46
46
// 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
+ }
52
54
} ;
53
55
54
56
window . addEventListener ( "beforeunload" , removePresence ) ;
You can’t perform that action at this time.
0 commit comments