@@ -11,7 +11,7 @@ const settings = { showAgain: true };
1111
1212function contextMenuPatch ( tree , context ) {
1313 const href = context . target . href || context . target . parentNode . href
14-
14+
1515 if ( href !== undefined ) {
1616 tree . props . children . push ( BdApi . ContextMenu . buildItem ( {
1717 type : "separator" ,
@@ -20,7 +20,7 @@ function contextMenuPatch(tree, context) {
2020 type : "text" , label : "open in mpv" , action : ( ) => {
2121 console . log ( "link is " + href ) ;
2222 const electron = require ( 'electron' ) ;
23-
23+
2424 electron . shell . openExternal ( 'mpv://' + href ) . then ( ( ) => {
2525 if ( settings . showAgain !== false ) {
2626 BdApi . UI . showConfirmationModal ( "Open in mpv" ,
@@ -29,7 +29,7 @@ function contextMenuPatch(tree, context) {
2929 confirmText : "Download setup.sh" , onConfirm : ( ) => {
3030 electron . shell . openExternal ( 'https://raw.githubusercontent.com/binarynoise/open-in-mpv/main/setup.sh' ) ;
3131 } ,
32-
32+
3333 cancelText : "Ok, don't show again" , onCancel : ( ) => {
3434 settings . showAgain = false ;
3535 BdApi . Data . save ( "open-in-mpv" , "settings" , settings ) ;
@@ -60,15 +60,15 @@ function Switch({ value, note, hideBorder, label }) {
6060 return ( React . createElement ( TheBigBoyBundle . FormSwitch , {
6161 value : enabled , note : note , hideBorder : hideBorder , onChange : e => {
6262 setEnabled ( e ) ;
63-
63+
6464 switch ( label ) {
6565 case "Show Dialog" :
6666 settings . showAgain = e ;
6767 break ;
6868 default :
6969 break ;
7070 }
71-
71+
7272 BdApi . Data . save ( "open-in-mpv" , "settings" , settings ) ;
7373 } ,
7474 } , label ) ) ;
@@ -96,6 +96,6 @@ function isEmpty(obj) {
9696 return false ;
9797 }
9898 }
99-
99+
100100 return true
101101}
0 commit comments