@@ -336,86 +336,4 @@ if (process.platform == "win32") {
336336 } ) ;
337337
338338 rpc . login ( { clientId } ) . catch ( ) ;
339- }
340-
341- // Set up IPC handlers for window control
342- ipcMain . handle ( 'window-minimize' , ( event ) => {
343- // Find the BrowserWindow that the request is coming from
344- const webContents = event . sender ;
345- const browserWindow = BrowserWindow . fromWebContents ( webContents ) ;
346-
347- if ( browserWindow ) {
348- browserWindow . minimize ( ) ;
349- return true ;
350- }
351- return false ;
352- } ) ;
353-
354- ipcMain . handle ( 'window-maximize' , ( event ) => {
355- // Find the BrowserWindow that the request is coming from
356- const webContents = event . sender ;
357- const browserWindow = BrowserWindow . fromWebContents ( webContents ) ;
358-
359- if ( browserWindow ) {
360- if ( browserWindow . isMaximized ( ) ) {
361- browserWindow . unmaximize ( ) ;
362- return false ;
363- } else {
364- browserWindow . maximize ( ) ;
365- return true ;
366- }
367- }
368- return false ;
369- } ) ;
370-
371- ipcMain . handle ( 'window-close' , ( event ) => {
372- // Find the BrowserWindow that the request is coming from
373- const webContents = event . sender ;
374- const browserWindow = BrowserWindow . fromWebContents ( webContents ) ;
375-
376- if ( browserWindow ) {
377- browserWindow . close ( ) ;
378- return true ;
379- }
380- return false ;
381- } ) ;
382-
383- ipcMain . handle ( 'window-is-maximized' , ( event ) => {
384- // Find the BrowserWindow that the request is coming from
385- const webContents = event . sender ;
386- const browserWindow = BrowserWindow . fromWebContents ( webContents ) ;
387-
388- if ( browserWindow ) {
389- return browserWindow . isMaximized ( ) ;
390- }
391- return false ;
392- } ) ;
393-
394- ipcMain . handle ( 'get-rpc-info' , async ( event ) => {
395- if ( ! win ) return '' ;
396- try {
397- const status = await win . webContents . executeJavaScript ( 'window.rpcinfo || ""' ) ;
398- currentStatus = status || 'Playing Sploder' ;
399- return status ;
400- } catch ( error ) {
401- return '' ;
402- }
403- } ) ;
404-
405- // Handler to update RPC status from renderer
406- ipcMain . handle ( 'update-rpc-status' , ( event , status ) => {
407- if ( status ) {
408- currentStatus = status ;
409- }
410- return currentStatus ;
411- } ) ;
412-
413- // Handler to provide application configuration to the renderer
414- ipcMain . handle ( 'get-config' , ( event ) => {
415- return config ;
416- } ) ;
417-
418- // Handler to get a specific URL
419- ipcMain . handle ( 'get-url' , ( event , endpoint ) => {
420- return config . getUrl ( endpoint ) ;
421- } ) ;
339+ }
0 commit comments