Add chokidar watcher settings.
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import { ipcMain } from "electron";
|
||||
import ipcTypes from "../../util/ipcTypes.json";
|
||||
import log from "electron-log/main";
|
||||
import { ipcMainHandleAuthStateChanged } from "./ipcMainHandler.user";
|
||||
import ipcTypes from "../../util/ipcTypes.json";
|
||||
import { StartWatcher } from "../watcher/watcher";
|
||||
import {
|
||||
SettingsWatchedFilePathsGet,
|
||||
SettingsWatchedFilePathsAdd,
|
||||
SettingsWatchedFilePathsGet,
|
||||
SettingsWatchedFilePathsRemove,
|
||||
} from "./ipcMainHandler.settings";
|
||||
// Log all IPC messages and their payloads
|
||||
import { ipcMainHandleAuthStateChanged } from "./ipcMainHandler.user";
|
||||
|
||||
// Log all IPC messages and their payloads
|
||||
const logIpcMessages = () => {
|
||||
// Get all message types from ipcTypes.toMain
|
||||
Object.keys(ipcTypes.toMain).forEach((key) => {
|
||||
@@ -37,8 +39,10 @@ ipcMain.on(ipcTypes.toMain.test, (payload: any) =>
|
||||
console.log("** Verify that ipcMain is loaded and working.", payload)
|
||||
);
|
||||
|
||||
//Auth handler
|
||||
ipcMain.on(ipcTypes.toMain.authStateChanged, ipcMainHandleAuthStateChanged);
|
||||
|
||||
//Settings Handlers
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.get,
|
||||
SettingsWatchedFilePathsGet
|
||||
@@ -47,4 +51,14 @@ ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.add,
|
||||
SettingsWatchedFilePathsAdd
|
||||
);
|
||||
ipcMain.handle(
|
||||
ipcTypes.toMain.settings.filepaths.remove,
|
||||
SettingsWatchedFilePathsRemove
|
||||
);
|
||||
|
||||
//Watcher Handlers
|
||||
ipcMain.on(ipcTypes.toMain.watcher.start, () => {
|
||||
StartWatcher();
|
||||
});
|
||||
|
||||
logIpcMessages();
|
||||
|
||||
Reference in New Issue
Block a user