16 lines
572 B
JavaScript
16 lines
572 B
JavaScript
const { ipcMain } = require("electron");
|
|
const { StartWatcher, StopWatcher } = require("./file-watcher");
|
|
const ipcTypes = require("../../src/ipc.types").default;
|
|
|
|
ipcMain.on(ipcTypes.filewatcher.start, async (event, arg) => {
|
|
console.log(ipcTypes.filewatcher.start);
|
|
const filePaths = StartWatcher();
|
|
event.sender.send(ipcTypes.filewatcher.startSuccess, filePaths);
|
|
});
|
|
|
|
ipcMain.on(ipcTypes.filewatcher.stop, async (event, arg) => {
|
|
console.log(ipcTypes.filewatcher.start);
|
|
StopWatcher();
|
|
event.sender.send(ipcTypes.filewatcher.start, { success: true });
|
|
});
|