@@ -310,11 +310,13 @@ window.Spicetify = {
310
310
} ;
311
311
312
312
( function addProxyCosmos ( ) {
313
- if ( ! Spicetify . Player . origin ?. _cosmos ) {
313
+ if ( ! Spicetify . Player . origin ?. _cosmos && ! Spicetify . Platform ?. Registry ) {
314
314
setTimeout ( addProxyCosmos , 50 ) ;
315
315
return ;
316
316
}
317
317
318
+ const _cosmos = Spicetify . Player . origin ?. _cosmos ?? Spicetify . Platform ?. Registry . _map . get ( Symbol . for ( "Cosmos" ) ) . instance ;
319
+
318
320
const corsProxyURL = "https://cors-proxy.spicetify.app" ;
319
321
const allowedMethodsMap = {
320
322
get : "get" ,
@@ -394,7 +396,7 @@ window.Spicetify = {
394
396
}
395
397
} ;
396
398
397
- Spicetify . Player . origin . _cosmos = new Proxy ( Spicetify . Player . origin . _cosmos , handler ) ;
399
+ Spicetify . Player . origin . _cosmos = new Proxy ( _cosmos , handler ) ;
398
400
Object . defineProperty ( Spicetify , "CosmosAsync" , {
399
401
get : ( ) => {
400
402
return Spicetify . Player . origin ?. _cosmos ;
@@ -697,6 +699,13 @@ window.Spicetify = {
697
699
}
698
700
} ) ;
699
701
702
+ const confirmDialogChunk = chunks . find (
703
+ ( [ , value ] ) => value . toString ( ) . includes ( "confirmDialog" ) && value . toString ( ) . includes ( "shouldCloseOnEsc" ) && value . toString ( ) . includes ( "isOpen" )
704
+ ) ;
705
+ if ( ! Spicetify . ReactComponent ?. ConfirmDialog && confirmDialogChunk ) {
706
+ Spicetify . ReactComponent . ConfirmDialog = Object . values ( require ( confirmDialogChunk [ 0 ] ) ) . find ( m => typeof m === "object" ) ;
707
+ }
708
+
700
709
const contextMenuChunk = chunks . find ( ( [ , value ] ) => value . toString ( ) . includes ( "toggleContextMenu" ) ) ;
701
710
if ( contextMenuChunk ) {
702
711
Spicetify . ReactComponent . ContextMenu = Object . values ( require ( contextMenuChunk [ 0 ] ) ) . find ( m => typeof m === "function" ) ;
0 commit comments