File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -444,28 +444,27 @@ export default class HasShapes {
444444 async getUniqueImportedElements ( ) : Promise < ImportElement [ ] > {
445445 for ( const element of this . importElements ) {
446446 const info = await this . getElementInfo ( element ) ;
447- const selector = XmlSlideHelper . getSelector ( info . sourceElement )
448- const eleHash = JSON . stringify ( selector )
447+ const selector = XmlSlideHelper . getSelector ( info . sourceElement ) ;
448+ const eleHash = JSON . stringify ( selector ) ;
449449 const alreadyImported = this . importElements . find (
450450 ( ele ) => ele . info ?. hash === eleHash ,
451451 ) ;
452452 if ( alreadyImported ) {
453- alreadyImported . info . callback = GeneralHelper . arrayify (
454- alreadyImported . info . callback ,
455- ) ;
456- const pushCallbacks = GeneralHelper . arrayify ( element . callback ) ;
457- if ( pushCallbacks . length ) {
458- alreadyImported . info . callback . push ( ...pushCallbacks ) ;
459- }
453+ const existingCallbacks = GeneralHelper . arrayify ( element . callback ) ;
454+ const pushCallbacks = GeneralHelper . arrayify ( alreadyImported . info . callback )
455+ alreadyImported . info . callback = [
456+ ...existingCallbacks ,
457+ ...pushCallbacks
458+ ]
460459 } else {
461460 info . hash = eleHash ;
462461 element . info = info ;
463462 }
464463 }
465464
466- return this . importElements . filter ( ele => {
467- return ele . info
468- } )
465+ return this . importElements . filter ( ( ele ) => {
466+ return ele . info ;
467+ } ) ;
469468 }
470469
471470 /**
You can’t perform that action at this time.
0 commit comments