File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
src/addons/addons/collaboration Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -726,8 +726,10 @@ export function performInitialSync() {
726726
727727 const remoteExtensions = sharedExtensions . toArray ( ) ;
728728 remoteExtensions . forEach ( ext => {
729- const extURL = ext . URL || ext ;
730- if ( ! vm . extensionManager . isExtensionLoaded ( extURL ) ) {
729+ const extObj = ( typeof ext . toJSON === 'function' ) ? ext . toJSON ( ) : ext ;
730+ const extURL = extObj . URL || extObj ;
731+ const extName = extObj . name || extObj ;
732+ if ( typeof extURL === 'string' && ! vm . extensionManager . isExtensionLoaded ( extName ) ) {
731733
732734 vm . extensionManager . loadExtensionURL ( extURL , false ) ;
733735 }
Original file line number Diff line number Diff line change @@ -181,8 +181,10 @@ function attachYjsProvider() {
181181
182182 const remoteExtensions = constants . mutableRefs . sharedExtensions . toArray ( ) ;
183183 remoteExtensions . forEach ( ext => {
184- const extURL = ext . URL || ext ;
185- if ( ! constants . mutableRefs . vm . extensionManager . isExtensionLoaded ( extURL ) ) {
184+ const extObj = ( typeof ext . toJSON === 'function' ) ? ext . toJSON ( ) : ext ;
185+ const extURL = extObj . URL || extObj ;
186+ const extName = extObj . name || extObj ;
187+ if ( typeof extURL === 'string' && ! constants . mutableRefs . vm . extensionManager . isExtensionLoaded ( extName ) ) {
186188 constants . mutableRefs . vm . extensionManager . loadExtensionURL ( extURL , false ) ;
187189 }
188190 } ) ;
@@ -704,8 +706,9 @@ function attachYjsProvider() {
704706 constants . mutableRefs . ydoc . transact ( ( ) => {
705707 const currentExts = constants . mutableRefs . sharedExtensions . toArray ( ) ;
706708 const alreadyExists = currentExts . some ( ext => {
707- if ( typeof ext === 'string' ) return ext === extension . URL || ext === extension . name ;
708- return ext . URL === extension . URL && ext . name === extension . name ;
709+ const extObj = ( typeof ext . toJSON === 'function' ) ? ext . toJSON ( ) : ext ;
710+ if ( typeof extObj === 'string' ) return extObj === extension . URL || extObj === extension . name ;
711+ return extObj . URL === extension . URL && extObj . name === extension . name ;
709712 } ) ;
710713 if ( ! alreadyExists ) {
711714 constants . mutableRefs . sharedExtensions . push ( [ extension ] ) ;
You can’t perform that action at this time.
0 commit comments