mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 17:33:55 +00:00
a41fe8806b
* chore: upgrade monorepo deps * chore: configure lint-staged * refactor: lenient use of any
12 lines
318 B
TypeScript
12 lines
318 B
TypeScript
export default function useElectronEvent() {
|
|
const isElectron = window?.process?.type === 'renderer';
|
|
|
|
const sendToElectron = (channel: string, args?: string | Record<string, unknown>) => {
|
|
if (isElectron) {
|
|
window?.ipcRenderer.send(channel, args);
|
|
}
|
|
};
|
|
|
|
return { isElectron, sendToElectron };
|
|
}
|