@@ -569,13 +569,19 @@ applyScrollingFix();
569
569
} ;
570
570
const reactComponentsUI = exposeReactComponentsUI ( { modules, functionModules, exportedForwardRefs } ) ;
571
571
572
- const knownMenuTypes = [ "album" , "show" , "artist" , "track" ] ;
572
+ const knownMenuTypes = [ "album" , "show" , "artist" , "track" , "playlist" ] ;
573
573
const menus = modules
574
- . map ( ( m ) => m ?. type ?. toString ( ) . match ( / v a l u e : " [ \w - ] + " / g) && [ m , ...m . type . toString ( ) . match ( / v a l u e : " [ \w - ] + " / g) ] )
574
+ . map ( ( m ) => {
575
+ const valueMatch = m ?. type ?. toString ( ) . match ( / v a l u e : " ( [ \w - ] + ) " / ) ;
576
+ if ( valueMatch ) return [ m , valueMatch [ 1 ] ] ;
577
+ const typeMatch = m ?. type ?. toString ( ) . match ( / t y p e : [ \w $ ] + \. [ \w $ ] + \. ( [ A - Z _ ] + ) / ) ;
578
+ if ( typeMatch ) return [ m , typeMatch [ 1 ] . toLowerCase ( ) ] ;
579
+ return null ;
580
+ } )
575
581
. filter ( Boolean )
576
582
. filter ( ( m ) => m [ 1 ] !== 'value:"row"' )
577
583
. map ( ( [ module , type ] ) => {
578
- type = type . match ( / v a l u e : " ( [ \w - ] + ) " / ) [ 1 ] ;
584
+ type = type . match ( / v a l u e : " ( [ \w - ] + ) " / ) ?. [ 1 ] ?? type ;
579
585
580
586
if ( ! knownMenuTypes . includes ( type ) ) return ;
581
587
if ( type === "show" ) type = "podcast-show" ;
@@ -895,7 +901,7 @@ applyScrollingFix();
895
901
const playlistMenuChunk = chunks . find (
896
902
( [ , value ] ) => value . toString ( ) . includes ( 'value:"playlist"' ) && value . toString ( ) . includes ( "canView" ) && value . toString ( ) . includes ( "permissions" )
897
903
) ;
898
- if ( playlistMenuChunk ) {
904
+ if ( playlistMenuChunk && ! Spicetify . ReactComponent ?. PlaylistMenu ) {
899
905
Spicetify . ReactComponent . PlaylistMenu = Object . values ( require ( playlistMenuChunk [ 0 ] ) ) . find (
900
906
( m ) => typeof m === "function" || typeof m === "object"
901
907
) ;
0 commit comments