1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

disable sleep inhibitor when lock-before-suspend disabled (#512)

This commit is contained in:
bokicoder
2025-10-21 01:03:27 +08:00
committed by GitHub
parent 6ac382a25f
commit 9a305355c2

View File

@@ -339,6 +339,7 @@ Singleton {
if (SettingsData.loginctlLockIntegration) { if (SettingsData.loginctlLockIntegration) {
syncLockBeforeSuspend() syncLockBeforeSuspend()
} }
syncSleepInhibitor()
} }
} }
@@ -407,7 +408,7 @@ Singleton {
if (!DMSService.apiVersion || DMSService.apiVersion < 4) return if (!DMSService.apiVersion || DMSService.apiVersion < 4) return
DMSService.sendRequest("loginctl.setSleepInhibitorEnabled", { DMSService.sendRequest("loginctl.setSleepInhibitorEnabled", {
enabled: SettingsData.loginctlLockIntegration enabled: SettingsData.loginctlLockIntegration && SettingsData.lockBeforeSuspend
}, response => { }, response => {
if (response.error) { if (response.error) {
console.warn("SessionService: Failed to sync sleep inhibitor:", response.error) console.warn("SessionService: Failed to sync sleep inhibitor:", response.error)