@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1212 return ( mod && mod . __esModule ) ? mod : { "default" : mod } ;
1313} ;
1414Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
15- exports . trimOptions = exports . notifyLaravel = exports . appendCookie = void 0 ;
15+ exports . trimOptions = exports . broadcastToWindows = exports . notifyLaravel = exports . appendCookie = void 0 ;
1616const electron_1 = require ( "electron" ) ;
1717const state_1 = __importDefault ( require ( "./state" ) ) ;
1818const axios_1 = __importDefault ( require ( "axios" ) ) ;
@@ -39,13 +39,21 @@ function notifyLaravel(endpoint, payload = {}) {
3939 catch ( e ) {
4040 }
4141 if ( endpoint === 'events' ) {
42- Object . values ( state_1 . default . windows ) . forEach ( window => {
43- window . webContents . send ( 'native-event' , payload ) ;
44- } ) ;
42+ broadcastToWindows ( 'native-event' , payload ) ;
4543 }
4644 } ) ;
4745}
4846exports . notifyLaravel = notifyLaravel ;
47+ function broadcastToWindows ( event , payload ) {
48+ var _a ;
49+ Object . values ( state_1 . default . windows ) . forEach ( window => {
50+ window . webContents . send ( event , payload ) ;
51+ } ) ;
52+ if ( ( _a = state_1 . default . activeMenuBar ) === null || _a === void 0 ? void 0 : _a . window ) {
53+ state_1 . default . activeMenuBar . window . webContents . send ( event , payload ) ;
54+ }
55+ }
56+ exports . broadcastToWindows = broadcastToWindows ;
4957function trimOptions ( options ) {
5058 Object . keys ( options ) . forEach ( key => options [ key ] == null && delete options [ key ] ) ;
5159 return options ;
0 commit comments