mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-28 05:36:34 +00:00
Merge pull request #4167 from balena-io/aethernet/fix-screensaver-error
Aethernet/fix screensaver error
This commit is contained in:
commit
e71d432675
@ -47,13 +47,7 @@ export function isFlashing(): boolean {
|
|||||||
*/
|
*/
|
||||||
export function setFlashingFlag() {
|
export function setFlashingFlag() {
|
||||||
// see https://github.com/balenablocks/balena-electron-env/blob/4fce9c461f294d4a768db8f247eea6f75d7b08b0/README.md#remote-methods
|
// see https://github.com/balenablocks/balena-electron-env/blob/4fce9c461f294d4a768db8f247eea6f75d7b08b0/README.md#remote-methods
|
||||||
try {
|
electron.ipcRenderer.send('disable-screensaver');
|
||||||
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({
|
store.dispatch({
|
||||||
type: Actions.SET_FLASHING_FLAG,
|
type: Actions.SET_FLASHING_FLAG,
|
||||||
data: {},
|
data: {},
|
||||||
@ -76,7 +70,8 @@ export function unsetFlashingFlag(results: {
|
|||||||
data: results,
|
data: results,
|
||||||
});
|
});
|
||||||
// see https://github.com/balenablocks/balena-electron-env/blob/4fce9c461f294d4a768db8f247eea6f75d7b08b0/README.md#remote-methods
|
// see https://github.com/balenablocks/balena-electron-env/blob/4fce9c461f294d4a768db8f247eea6f75d7b08b0/README.md#remote-methods
|
||||||
electron.ipcRenderer.invoke('enable-screensaver');
|
|
||||||
|
electron.ipcRenderer.send('enable-screensaver');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setDevicePaths(devicePaths: string[]) {
|
export function setDevicePaths(devicePaths: string[]) {
|
||||||
|
@ -112,10 +112,10 @@ function startApiAndSpawnChild({
|
|||||||
// server/client has a different name.
|
// server/client has a different name.
|
||||||
const IPC_SERVER_ID = `etcher-server-${process.pid}-${Date.now()}-${
|
const IPC_SERVER_ID = `etcher-server-${process.pid}-${Date.now()}-${
|
||||||
withPrivileges ? 'privileged' : 'unprivileged'
|
withPrivileges ? 'privileged' : 'unprivileged'
|
||||||
}}}`;
|
}`;
|
||||||
const IPC_CLIENT_ID = `etcher-client-${process.pid}-${Date.now()}-${
|
const IPC_CLIENT_ID = `etcher-client-${process.pid}-${Date.now()}-${
|
||||||
withPrivileges ? 'privileged' : 'unprivileged'
|
withPrivileges ? 'privileged' : 'unprivileged'
|
||||||
}}`;
|
}`;
|
||||||
|
|
||||||
const IPC_SOCKET_ROOT = path.join(
|
const IPC_SOCKET_ROOT = path.join(
|
||||||
process.env.XDG_RUNTIME_DIR || os.tmpdir(),
|
process.env.XDG_RUNTIME_DIR || os.tmpdir(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user