From 19eab0418aadc35062fddf94df51491cdf0e0a38 Mon Sep 17 00:00:00 2001 From: derr <1457522662@qq.com> Date: Sat, 7 Mar 2026 13:56:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(mac):=20=E4=BF=AE=E5=A4=8D=20Mac=20?= =?UTF-8?q?=E7=9D=A1=E7=9C=A0=E5=AF=BC=E8=87=B4=E9=9F=B3=E4=B9=90=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E4=B8=AD=E6=96=AD=E7=9A=84=E9=97=AE=E9=A2=98=20(#2692?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(mac): prevent sleep on mac during playback * Remove space between async and parentheses in functions --------- Co-authored-by: ydm Co-authored-by: lyswhut --- src/main/utils/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/utils/index.ts b/src/main/utils/index.ts index 8d98c5ad..64fbea51 100644 --- a/src/main/utils/index.ts +++ b/src/main/utils/index.ts @@ -1,4 +1,4 @@ -import { encodePath, isUrl, throttle } from '@common/utils' +import { encodePath, isUrl, throttle, isMac } from '@common/utils' import migrateSetting from '@common/utils/migrateSetting' import getStore from '@main/utils/store' import { STORE_NAMES, URL_SCHEME_RXP } from '@common/constants' @@ -293,7 +293,7 @@ export const setPowerSaveBlocker = (enabled: boolean) => { let isEnabled = powerSaveBlockerId != null && powerSaveBlocker.isStarted(powerSaveBlockerId) if (enabled) { if (isEnabled) return - powerSaveBlockerId = powerSaveBlocker.start('prevent-app-suspension') + powerSaveBlockerId = powerSaveBlocker.start(isMac ? 'prevent-display-sleep' : 'prevent-app-suspension') } else { if (!isEnabled) return powerSaveBlocker.stop(powerSaveBlockerId!)