Skip to content

Commit 97d7ca9

Browse files
committed
prevent sleep + versionbump
1 parent 9c7b985 commit 97d7ca9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

main.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const { app, BrowserWindow } = require('electron')
1+
const { app, BrowserWindow, powerSaveBlocker } = require('electron')
2+
23
app.disableHardwareAcceleration()
34

45
global.twig = require('electron-twig');
@@ -34,6 +35,10 @@ var tools = require("./tools")
3435

3536
const { ipcMain } = require('electron')
3637

38+
const id = powerSaveBlocker.start('prevent-display-sleep')
39+
console.log(powerSaveBlocker.isStarted(id))
40+
41+
3742

3843
ipcMain.on('test', async (event, arg) => {
3944

@@ -273,6 +278,8 @@ catch (e) {
273278
// DEFAULT
274279
app.whenReady().then(createWindow)
275280
app.on('window-all-closed', () => {
281+
powerSaveBlocker.stop(id)
282+
console.log('close')
276283
if (process.platform !== 'darwin') {
277284
app.quit()
278285
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sidenoder",
3-
"version": "0.0.15",
3+
"version": "0.0.16",
44
"description": "SideNoder",
55
"main": "main.js",
66
"dependencies": {

0 commit comments

Comments
 (0)