mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 03:06:38 +00:00
fix disabled-screensaver unhandled exception outside balena-electron env
Change-type: patch
This commit is contained in:
parent
615e035a5d
commit
46c406e8c1
@ -47,7 +47,13 @@ export function isFlashing(): boolean {
|
||||
*/
|
||||
export function setFlashingFlag() {
|
||||
// see https://github.com/balenablocks/balena-electron-env/blob/4fce9c461f294d4a768db8f247eea6f75d7b08b0/README.md#remote-methods
|
||||
electron.ipcRenderer.invoke('disable-screensaver');
|
||||
try {
|
||||
electron.ipcRenderer.invoke('disable-screensaver');
|
||||
} catch (error) {
|
||||
console.log(
|
||||
"Can't disable-screensaver, we're probably not running on a balena-electron env",
|
||||
);
|
||||
}
|
||||
store.dispatch({
|
||||
type: Actions.SET_FLASHING_FLAG,
|
||||
data: {},
|
||||
|
Loading…
x
Reference in New Issue
Block a user