修复win7下的电源锁清理问题

pull/1869/head
lyswhut 2024-04-16 18:37:35 +08:00
parent 9016796497
commit 5bc119bd9d
2 changed files with 5 additions and 4 deletions

View File

@ -7,12 +7,12 @@ const baseConfig = require('./webpack.config.base')
// const { dependencies } = require('../../package.json') // const { dependencies } = require('../../package.json')
const buildConfig = require('../webpack-build-config') // const buildConfig = require('../webpack-build-config')
module.exports = merge(baseConfig, { module.exports = merge(baseConfig, {
mode: 'production', mode: 'production',
devtool: 'source-map', devtool: false,
entry: { entry: {
main: path.join(__dirname, '../../src/main/index.ts'), main: path.join(__dirname, '../../src/main/index.ts'),
// 'dbService.worker': path.join(__dirname, '../../src/main/worker/dbService/index.ts'), // 'dbService.worker': path.join(__dirname, '../../src/main/worker/dbService/index.ts'),
@ -45,6 +45,6 @@ module.exports = merge(baseConfig, {
maxAssetSize: 1024 * 1024 * 20, maxAssetSize: 1024 * 1024 * 20,
}, },
optimization: { optimization: {
minimize: buildConfig.minimize, minimize: false,
}, },
}) })

View File

@ -290,6 +290,7 @@ export const setPowerSaveBlocker = (enabled: boolean) => {
powerSaveBlockerId = powerSaveBlocker.start('prevent-app-suspension') powerSaveBlockerId = powerSaveBlocker.start('prevent-app-suspension')
} else { } else {
if (!isEnabled) return if (!isEnabled) return
if (powerSaveBlocker.stop(powerSaveBlockerId!)) powerSaveBlockerId = null powerSaveBlocker.stop(powerSaveBlockerId!)
powerSaveBlockerId = null
} }
} }