[Config] Shorten IPC event names, remove argv filtering on restart as unneeded
This commit is contained in:
		
							parent
							
								
									4e18696b43
								
							
						
					
					
						commit
						c20e652eed
					
				
					 2 changed files with 7 additions and 7 deletions
				
			
		|  | @ -26,19 +26,19 @@ const open = exports.open = () => { | |||
|   settings.set('openasar', config); | ||||
|   settings.save(); | ||||
| 
 | ||||
|   ipcMain.on('config_set', (e, c) => { | ||||
|   ipcMain.on('cs', (e, c) => { | ||||
|     config = c; | ||||
|     settings.set('openasar', config); | ||||
|     settings.save(); // Ensure saving
 | ||||
|   }); | ||||
| 
 | ||||
|   ipcMain.on('config_get', (e) => { | ||||
|   ipcMain.on('cg', (e) => { | ||||
|     e.returnValue = config; | ||||
|   }); | ||||
| 
 | ||||
|   ipcMain.on('config_restart', () => { | ||||
|   ipcMain.on('cr', () => { | ||||
|     settings.save(); | ||||
|     app.relaunch({ args: process.argv.filter((x) => x !== '--config') }); | ||||
|     app.relaunch({ args: process.argv }); | ||||
|     app.exit(); | ||||
|   }); | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ const { contextBridge, ipcRenderer } = require('electron'); | |||
| 
 | ||||
| 
 | ||||
| contextBridge.exposeInMainWorld('Native', { | ||||
|   restart: () => ipcRenderer.send('config_restart'), | ||||
|   set: c => ipcRenderer.send('config_set', c), | ||||
|   get: () => ipcRenderer.sendSync('config_get') | ||||
|   restart: () => ipcRenderer.send('cr'), | ||||
|   set: c => ipcRenderer.send('cs', c), | ||||
|   get: () => ipcRenderer.sendSync('cg') | ||||
| }); | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue