File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
- const { app, BrowserWindow } = require ( 'electron' )
1
+ const { app, BrowserWindow, powerSaveBlocker } = require ( 'electron' )
2
+
2
3
app . disableHardwareAcceleration ( )
3
4
4
5
global . twig = require ( 'electron-twig' ) ;
@@ -34,6 +35,10 @@ var tools = require("./tools")
34
35
35
36
const { ipcMain } = require ( 'electron' )
36
37
38
+ const id = powerSaveBlocker . start ( 'prevent-display-sleep' )
39
+ console . log ( powerSaveBlocker . isStarted ( id ) )
40
+
41
+
37
42
38
43
ipcMain . on ( 'test' , async ( event , arg ) => {
39
44
@@ -273,6 +278,8 @@ catch (e) {
273
278
// DEFAULT
274
279
app . whenReady ( ) . then ( createWindow )
275
280
app . on ( 'window-all-closed' , ( ) => {
281
+ powerSaveBlocker . stop ( id )
282
+ console . log ( 'close' )
276
283
if ( process . platform !== 'darwin' ) {
277
284
app . quit ( )
278
285
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " sidenoder" ,
3
- "version" : " 0.0.15 " ,
3
+ "version" : " 0.0.16 " ,
4
4
"description" : " SideNoder" ,
5
5
"main" : " main.js" ,
6
6
"dependencies" : {
You can’t perform that action at this time.
0 commit comments