@@ -39,20 +39,15 @@ ipcMain.on("loudNotification", function (): void {
39
39
} ) ;
40
40
41
41
let powerSaveBlockerId : number | null = null ;
42
- ipcMain . on ( "app_onAction" , function ( _ev : IpcMainEvent , payload ) {
43
- switch ( payload . action ) {
44
- case "call_state" : {
45
- if ( powerSaveBlockerId !== null && powerSaveBlocker . isStarted ( powerSaveBlockerId ) ) {
46
- if ( payload . state === "ended" ) {
47
- powerSaveBlocker . stop ( powerSaveBlockerId ) ;
48
- powerSaveBlockerId = null ;
49
- }
50
- } else {
51
- if ( powerSaveBlockerId === null && payload . state === "connected" ) {
52
- powerSaveBlockerId = powerSaveBlocker . start ( "prevent-display-sleep" ) ;
53
- }
54
- }
55
- break ;
42
+ ipcMain . on ( "callState" , function ( _ev : IpcMainEvent , state ) {
43
+ if ( powerSaveBlockerId !== null && powerSaveBlocker . isStarted ( powerSaveBlockerId ) ) {
44
+ if ( state === "ended" ) {
45
+ powerSaveBlocker . stop ( powerSaveBlockerId ) ;
46
+ powerSaveBlockerId = null ;
47
+ }
48
+ } else {
49
+ if ( powerSaveBlockerId === null && state === "connected" ) {
50
+ powerSaveBlockerId = powerSaveBlocker . start ( "prevent-display-sleep" ) ;
56
51
}
57
52
}
58
53
} ) ;
@@ -65,15 +60,9 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
65
60
let ret : any ;
66
61
67
62
switch ( payload . name ) {
68
- case "getUpdateFeedUrl" :
69
- ret = autoUpdater . getFeedURL ( ) ;
70
- break ;
71
63
case "setLanguage" :
72
64
global . appLocalization . setAppLocale ( args [ 0 ] ) ;
73
65
break ;
74
- case "getAppVersion" :
75
- ret = app . getVersion ( ) ;
76
- break ;
77
66
case "focusWindow" :
78
67
if ( global . mainWindow . isMinimized ( ) ) {
79
68
global . mainWindow . restore ( ) ;
@@ -229,4 +218,8 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
229
218
} ) ;
230
219
} ) ;
231
220
221
+ ipcMain . handle ( "getCanSelfUpdate" , ( ) => ! ! autoUpdater . getFeedURL ( ) ) ;
222
+
223
+ ipcMain . handle ( "getVersion" , ( ) => app . getVersion ( ) ) ;
224
+
232
225
ipcMain . handle ( "getConfig" , ( ) => global . vectorConfig ) ;
0 commit comments