diff --git a/docs/api/power-save-blocker.md b/docs/api/power-save-blocker.md index 257fc76f3d..1ba95f0aab 100644 --- a/docs/api/power-save-blocker.md +++ b/docs/api/power-save-blocker.md @@ -49,6 +49,8 @@ is used. Stops the specified power save blocker. +Returns `boolean` - Whether the specified `powerSaveBlocker` has been stopped. + ### `powerSaveBlocker.isStarted(id)` * `id` Integer - The power save blocker id returned by `powerSaveBlocker.start`. diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index 27ea0da6c3..a81377cbe1 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -904,7 +904,8 @@ app.whenReady().then(() => { const id = powerSaveBlocker.start('prevent-display-sleep'); console.log(powerSaveBlocker.isStarted(id)); -powerSaveBlocker.stop(id); +const stopped = powerSaveBlocker.stop(id); +console.log(`The powerSaveBlocker is ${stopped ? 'stopped' : 'not stopped'}`); // protocol // https://github.com/electron/electron/blob/main/docs/api/protocol.md